Skip to main content
Solved

Determine non-spatial dataset


Hello,

 

How to determine if input dataset choesn by user has geometry or not. I want to process spatial data by extracting co-ordinates but there could be non-spatial data as well. So I need to to develop two branches one for spatial data and other for non-spatial data?

 

 

how to go about it?

Best answer by mark

Two solutions I can think of.

 

 

Probably a Startup script (Python or Tcl) would do the job. You could create a script to examine the source file parameters to determine what type of data is being read.

 

 

Alternatively, use the GeometryFilter to determine whether the data is spatial or tabular, and then connect the output to a WorkspaceRunner to run a different workspace depending on the geometry type. A Sampler transformer would let you reduce it to testing a single feature, to speed things up and ensure the workspaceRunner is only triggered once.

 

 

Hope this helps

 

 

Mark

 

 

Mark Ireland

 

Product Evangelist

 

Safe Software Inc.
View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

david_r
Celebrity
  • June 20, 2014
Hi,

 

 

you can use a GeometryFilter: the features exiting through the NULL port have no geometry.

 

 

David

  • Author
  • June 20, 2014
Thanks for your quick response. GeometryFilter will check each and every feature that could work but in my case user either could select Spatial dataset e.g.shp or mid.mif or he/she could select non-spatial data e.g. csv or txt data file. I need to process both files in different way. So needto figure out whether file is spatial or non-spatial. Is there any better way?

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • June 20, 2014
use a file/derectory reader and check extension?

Forum|alt.badge.img
  • Best Answer
  • June 23, 2014
Two solutions I can think of.

 

 

Probably a Startup script (Python or Tcl) would do the job. You could create a script to examine the source file parameters to determine what type of data is being read.

 

 

Alternatively, use the GeometryFilter to determine whether the data is spatial or tabular, and then connect the output to a WorkspaceRunner to run a different workspace depending on the geometry type. A Sampler transformer would let you reduce it to testing a single feature, to speed things up and ensure the workspaceRunner is only triggered once.

 

 

Hope this helps

 

 

Mark

 

 

Mark Ireland

 

Product Evangelist

 

Safe Software Inc.

  • Author
  • June 24, 2014
Thanks Mark. GeometryFilter will test each and every feature but I am not able to figure out how to make sure that WorkspaceRunner is triggered only once.

  • Author
  • June 24, 2014
Thanks mark. Got it. Using Sampler done the trick.

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings