Question

reprojecting from custom coordinate system gives incorrect results

  • 5 November 2015
  • 6 replies
  • 21 views

Badge
I have an ecw file that is in a custom coordinate system, which i want to reproject into EPSG 3857. I included the parameters for the custom coordinate system in MyCoordSysDefs.fme, and then use the reprojector transformer. The resulting image (also ecw) is off by a fair amount, about 20 miles. Another thing to note, the original image is 4GB and the new image that is created is 16GB. I've played around with the compression percentage options but haven't figured out how to get it to be the same. I do have a prj file that has the coordinate system specificiations. Can anyone help?

 


6 replies

Badge +7
If you have a PRJ file, you can just dump the text from that as a new attribute, then use the CoordinateSystemDescriptionConverter to convert from Esri WKT to FME Representation, which the Reprojector and CsmapReprojector both read - this avoids the pain of having to delve into custom coordinate systems.

 

 

If that still seems wrong (which I have seen before) then there's probably a problem with your PRJ file definition. I had one recently where ArcMap seemed to be ignoring the False_Easting and False_Northing, while FME was observing them.

 

 

For your image compression question, the best would be to analyse the original file somehow. I'm not sure what tools exist for ECWs though - there's a great command line tool called tiffinfo for TIFFs. Maybe gdalinfo would give you some useful information about why it's so small?
Badge
thanks for the reply. I'm not quite sure how to do what you suggest above - do I bring the prj file in as a text file and then use that transformer to create a new text file in FME representation? How do I relate this to the image? Also when i look at the coordinate sustem properties in arcgis, it shows as custom, not as ESRU WKT.

 

Userlevel 4
Badge +25
Often an FME format can extract information from a prj file if it has the same name. So if the ecw is filename.ecw you could try renaming the prj file to filename.prj and read the data to see if FME uses it. It may, but it may not (I can't tell if ECW supports this).

 

 

Either way, it's unclear whether the offset is caused by reading or writing the data. If it's writing, then it's likely to be an FME issue. If it's reading, then it's likely to be your coordsys definition. To find out, read the data into the FME Data Inspector using the custom coordsys. If it falls into the correct location, then the reading part is correct. Just be careful to turn off background maps, else the data could get reprojected anyway.

 

Badge
Thanks for the reply mark. If I read it into inspector, how do I know it's landing in the right place without loading in a background map?

 

Badge +7
Sorry - to answer your question to me:

 

1. Add an AttributeCreator after your feature reader

 

2. Open the PRJ file in a text editor and paste in the text contents as a new attribute value

 

3. Add a CoordinateSystemDescriptionConverter and set to convert the attribute to FME notation

 

 

Esri WKT ("well-known text") is just the format - it's the way it's expressed with square brackets and so-on - I believe "custom" is Esri WKT as long as it has a load of numbers with it.

 

 

To answer your question to Mark, presumably you have some other data for that location that you can compare against? If not, you can still estimate whether the coordinates look correct?
Badge
@rollo thanks for getting back to me - I tried your method but still got the same result when the reprojection finished where the image is off some miles. As to my question to mark, I was assuming that the inspector would read another layer in the same custom coordinate system so they would overlay, regardless of whether or not they are landing in the right place. I did add another layer in the same system, which did overlay, and then also added that same layer reprojected into a standard system, and that did not overlay (i don't know how inspector handles layers in different systems). I'm thinking based on all this that the coordinate system is not being read properly.Not sure what to do from this point.

 

Reply