Question

add projection to workbench on server

  • 18 October 2018
  • 4 replies
  • 10 views

Badge

I am working on a CAD to ESRI Shape tool that is being hosted on FME Server. The user only needs to upload the CAD files and a spreadsheet for categorization and the output is the ESRI shapes. I have everything working except the requirement for defining the coordinate system. A lot of my work is done in Colorado where the elevation dictates a custom projection for every project. I usually have an ESRI prj file for the project but the CAD files do not have a projection defined within them. This custom projection is needed in order to properly create the shape files. Is there anyway to load the ESRI prj file into the process on the Server?

The online tool will be used by people who can load a prj file and they understand GIS files, but they only have a rudimentary understanding of projections so I am trying to keep this as simple as possible.


4 replies

Badge +7

Hi @tsurveyor, thanks for the question,

 

Is the goal simply to have the proper ESRI .prj output with the Shapefiles every time the job is run? Do you need to do any reprojections or transformations within the process? Will you always have access to the project .prj or do you want to rely on end users to upload it each time at runtime?

If you will always know ahead of time the definitions of the custom coordinate systems, you can upload them as resources to the FME Server engines, much like adding a custom coordinate system to FME Desktop. You can then use the custom definitions to define the coordinate system of your features in FME. If you would rather have the end user upload the specific .prj at each runtime, you can probably configure your workspace to process the .prj file (it is simply text, after all - try the Textline Reader/Writer) and either output it along with the resulting Shapefile, or use it to set the coordinate system within the workspace.

 

 

Hope this provides you with at least a couple high-level ideas. Let us know if you are stuck on the technical side of this.

 

 

Nathan
Badge

Hi @tsurveyor, thanks for the question,

 

Is the goal simply to have the proper ESRI .prj output with the Shapefiles every time the job is run? Do you need to do any reprojections or transformations within the process? Will you always have access to the project .prj or do you want to rely on end users to upload it each time at runtime?

If you will always know ahead of time the definitions of the custom coordinate systems, you can upload them as resources to the FME Server engines, much like adding a custom coordinate system to FME Desktop. You can then use the custom definitions to define the coordinate system of your features in FME. If you would rather have the end user upload the specific .prj at each runtime, you can probably configure your workspace to process the .prj file (it is simply text, after all - try the Textline Reader/Writer) and either output it along with the resulting Shapefile, or use it to set the coordinate system within the workspace.

 

 

Hope this provides you with at least a couple high-level ideas. Let us know if you are stuck on the technical side of this.

 

 

Nathan
Nathan, thanks for the response. I want the end user to be able to upload the prj each job; almost every project we work in has its own custom projection. I am piqued by your comment about being able to use it to set the coordinate system within the workspace. Everything else I've done the custom projection had to be added to the CS library. How do I set the coordinate system on the fly within the workspace using an ESRI prj file?

 

The other question is process it using Textline - are you saying that sending it the Shapefile writer with the rest of vector data will create the shapefiles' CS based on the text file instead of the stuff coming out of the geometry filter? I really appreciate your help on this.

 

I asked a subsequent question here after trying different things:

 

https://knowledge.safe.com/questions/80819/replace-one-text-file-with-another-or-overwrite-te.html

 

 

Badge +7
Nathan, thanks for the response. I want the end user to be able to upload the prj each job; almost every project we work in has its own custom projection. I am piqued by your comment about being able to use it to set the coordinate system within the workspace. Everything else I've done the custom projection had to be added to the CS library. How do I set the coordinate system on the fly within the workspace using an ESRI prj file?

 

The other question is process it using Textline - are you saying that sending it the Shapefile writer with the rest of vector data will create the shapefiles' CS based on the text file instead of the stuff coming out of the geometry filter? I really appreciate your help on this.

 

I asked a subsequent question here after trying different things:

 

https://knowledge.safe.com/questions/80819/replace-one-text-file-with-another-or-overwrite-te.html

 

 

Hi @tsurveyor,

 

You are right that in order to really apply the coordinate system to features within the workspace, it will need to be defined and added as a customer projection. I was thinking even this would be possible if the workspace itself parsed the .prj, defined a new projection, and wrote it to the coordinate systems folder on FME Server. But since the FME Server engines need to be restarted before the added custom projection can be used, this is making less sense.

 

I think Takashi's latest idea on your other thread is going to prove the best solution. Make use of the FileCopy writer and the summary port of the FeatureWriter to effectively copy the input .prj to the shapefile folder, overwriting any existing .prj.

 

Hope this helps,

 

Nathan

 

Badge

thanks Nathan, appreciate your response and writing down your thought process.

Reply