Hello there

I exchanged some e-mails a while ago with Jody, about issues with 
spatial references when creating a schema on PostgisDataStore. Please see:
http://n2.nabble.com/SRID-problems-when-writing-to-PostGIS-td1093252.html

I guess the conversation kind of died out, but we here did implement 
what I see as the solution to the problem. Basically, I exchanged lines 
1287-1298 with the following code:

if (ident == null || ident.isEmpty()){
     if (refSys == DefaultGeographicCRS.WGS84)
         SRID = 4326;
     else
         SRID = CRS.lookupEpsgCode(refSys, true);
}
else{
     String code = ((NamedIdentifier) ident.toArray()[0]).getCode();
     SRID = Integer.parseInt(code);
}

If it's OK with you, I can open up a JIRA task and send the patch over 
there. I'm just not sure about the best way to implement a test for 
that, though, since method createSchema() is quite large and uses tests 
shared with DataTestCase, something like that. One thing we could do 
would be to separate the task of figuring out the SRID as an independent 
private or protected method (say, "getSRID"), and then use Java 
reflection to access that method for testing purposes. Just an idea.

Cheers
Milton

-- 

Milton Jonathan
Grupo GIS e Meio Ambiente
Tecgraf/PUC-Rio
Tel: +55-21-3527-2502

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to