same here :),

better as an issue on github and definitely Mikes cup of coffee .. sunny 
regards ede

On 18.08.2022 09:55, Giuseppe Aruta wrote:
Hi all,
with the new OJ 2.1 adopted an external file (coord_ref_sys) to read OGC code 
on saving to.prj file (shapefile).  Reading code is related to the method 
EsriProj.findProj(...)
If the external coord_ref_sys file is not found, when I try to save to 
shapefile, OJ throws an exception and the file cannot be saved (no problem with 
GML).

Until OpenJUMP 1.16, the process to generate OGC code was related to the method 
SridLookupTable.getOGCWKTFromWkidCode(...) which reads a text file integrated 
into OpenJUMP (srid2prj.txt) with all the prj codes (even if related to some 
years ago).

To avoid the previous error, my proposal is, in the file *ShapeFileWriter*
substitute method:

private String getPrjString(String code) throws Exception {
         try {
            int srid = Integer.parseInt(code);
            return EsriProj.findProj(srid);
         } catch(IOException e) {
             Logger.warn(e);
             return null;
         }
     }


with method:

     private String getPrjString(String code) throws Exception {
         try {
int srid = Integer.parseInt(code);
return EsriProj.findProj(srid);
         } catch(IOException e) {
             return SridLookupTable.getOGCWKTFromWkidCode(code);
         } catch (Exception e) {
Logger.warn(e);
             return null;
         }
     }

Note that   SridLookupTable.getOGCWKTFromWkidCode(...) and srid2prj.txt)  are 
used also on saving sextante raster to export a .prj or .aux file with all the 
projection info

Best ragards

Peppe


_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to