Great Emily, thanks fo coming back to us with this piece of code.

Andrea

On Wed, May 27, 2009 at 6:53 PM, Emily Gouge <[email protected]> wrote:
> Just to follow up on this issue the instructions in the link provided by
> Andrea work just fine (Thanks).  I was able to add the 3785 projection to
> uDig using the following code (and an epsg.properties file with the
> definition of the projection):
>
>
> Hints hints = new Hints(Hints.CRS_AUTHORITY_FACTORY,
> PropertyAuthorityFactory.class);
>
> ReferencingFactoryContainer referencingFactoryContainer =
> ReferencingFactoryContainer.instance(hints);
>
> PropertyAuthorityFactory factory = new PropertyAuthorityFactory(
>  referencingFactoryContainer,
>  Citations.fromName("EPSG"),
>  Activator.class.getClassLoader().getResource("epsg.properties").toURI().toURL());
>
> ReferencingFactoryFinder.addAuthorityFactory(factory);
>
> ReferencingFactoryFinder.scanForPlugins();
>
>
> The key thing that took me a while to sort out was the last line
> "ReferencingFactoryFinder.scanForPlugins()".  Without this line it doesn't
> work (at least it didn't work for me).
>
> Emily
>
>
> Emily Gouge wrote:
>>
>> Interesting, thanks for the link.  I don't know if this would work or not.
>>  I never tried it; if I get the chance I'll look at let you know, but I'm
>> not sure I have the time at the moment.
>>
>> Emily
>>
>> andrea antonello wrote:
>>>
>>> Hi Emily,
>>>
>>>> I would guess that this works well for 1.1, but for uDig trunk we are
>>>> using
>>>
>>> Yes exactly, I forgot while writing that it was that way.
>>>
>>> BTW, I chose that method, since the methods added here:
>>>
>>> http://docs.codehaus.org/display/GEOTDOC/11+Referencing+FAQ#11ReferencingFAQ-HowdoIextendthesystemwithmyowncustomCRS%3F
>>>
>>> were not available in the old API. Any reason the above not working on
>>> trunk?
>>>
>>> I was planning to do that on trunk later on .
>>>
>>>
>>> Ciao
>>> Andrea
>>>
>>>
>>>
>>>
>>>> the hsql version of the epsg jar which doesn't seem to have
>>>> epsg.properties
>>>> file in it.  Instead it has an EPSG.sql file which seems much harder to
>>>> understand :)  However, this looks like it might be what I need to edit.
>>>>  I'll play around with it and see if I can figure it out.
>>>>
>>>> Thanks!
>>>> Emily
>>>>
>>>> andrea antonello wrote:
>>>>>
>>>>> Hi Emily,
>>>>>
>>>>>> Yes, this is on uDig trunk.
>>>>>>
>>>>>> I saw this page but it doesn't help me because neither 900913 or 3785
>>>>>> are
>>>>>> in
>>>>>> the geotools epsg-hsql jar (or at least I can't find them).  I don't
>>>>>> know
>>>>>> how to add something to this jar for my local use; or add it somewhere
>>>>>> else.
>>>>>>
>>>>>> I see the "Adding the Projection" section; but to what am I adding
>>>>>> that
>>>>>> insert statement?
>>>>>
>>>>> Since I needed to do that for udig 1.1, I have solved it the way you
>>>>> need it also.
>>>>> Inside the epsg jar you will find an epsg.properties file. Inside
>>>>> there the list of crs is kept, one per line:
>>>>>
>>>>> epsgnumber=WKTdefinition
>>>>>
>>>>> Make sure you have a unique number and add your definition.
>>>>> What I do is substitute the original jar in the udig libs at the first
>>>>> time JGrass is run. You might make a custom package so you probably
>>>>> don't need that.
>>>>>
>>>>> Ciao
>>>>> Andrea
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Thanks,
>>>>>> Emily
>>>>>>
>>>>>> Jody Garnett wrote:
>>>>>>>
>>>>>>> I hope this is udig trunk? The google projection now has an offical
>>>>>>> epsg
>>>>>>> code...
>>>>>>>
>>>>>>> http://docs.codehaus.org/display/GEOTDOC/08+Google+Maps+Projection
>>>>>>>
>>>>>>> On Thu, May 14, 2009 at 4:35 AM, Emily Gouge <[email protected]>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> I have a GeoWebCache layer in projection 900913.  I'm trying to view
>>>>>>>> this
>>>>>>>> layer in uDig however uDig doesn't recognize the 900913 projection
>>>>>>>> (even
>>>>>>>> if
>>>>>>>> I add it as a custom CRS).  Any ideas on how I can get uDig to
>>>>>>>> recognize
>>>>>>>> the
>>>>>>>> 900913 projection - how can I add it to default list of projections
>>>>>>>> supported by uDig (either manually or programmatically)?
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Emily
>>>>>>>> _______________________________________________
>>>>>>>> User-friendly Desktop Internet GIS (uDig)
>>>>>>>> http://udig.refractions.net
>>>>>>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> User-friendly Desktop Internet GIS (uDig)
>>>>>>> http://udig.refractions.net
>>>>>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>>>>>
>>>>>> _______________________________________________
>>>>>> User-friendly Desktop Internet GIS (uDig)
>>>>>> http://udig.refractions.net
>>>>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>>>>>
>>>>> _______________________________________________
>>>>> User-friendly Desktop Internet GIS (uDig)
>>>>> http://udig.refractions.net
>>>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>>>
>>>> _______________________________________________
>>>> User-friendly Desktop Internet GIS (uDig)
>>>> http://udig.refractions.net
>>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>>>
>>> _______________________________________________
>>> User-friendly Desktop Internet GIS (uDig)
>>> http://udig.refractions.net
>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>
>> _______________________________________________
>> User-friendly Desktop Internet GIS (uDig)
>> http://udig.refractions.net
>> http://lists.refractions.net/mailman/listinfo/udig-devel
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
>
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

Reply via email to