Skip to main content
Solved

Readers and Schemas

  • October 23, 2017
  • 6 replies
  • 55 views

dbklingdom
Contributor
Forum|alt.badge.img+7

I have a folder full of unzip (.shp) mixed shape files Points, Lines, and Polys. Can I read in only the points somehow?? If not can anyone recommend a way to restrict to schema to only that of the point shapes, which I have found two different ones so far?

Best answer by takashi

Hi @dbklingdom, I would try this.

  1. Read schema features from the target *.shp files with the Schema (Any Format) reader. Expose "fme_geomatry{}" and "fme_dataset" in the "schema" feature type.
  2. Use the Tester to select only schema features having value "fme_point" in the "fme_geometry{0}".
  3. Read the point Shapefile datasets using the FeatureReader with setting "fme_dataset" to the Dataset parameter.
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, 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

trentatsafe
Safer
Forum|alt.badge.img+6
  • Safer
  • October 23, 2017

Hello @dbklingdom ,

 

 

A quick way that I can think of would involve using a Merged Filter on your Shape reader(if the point shapefiles have a different naming convention you could filter here eg: '*_point'). Alternatively, if you read in all of the Shapefiles and use a GeometryFilter. You could then allow only the point features to be passed on to the rest of the translation. I hope that helps.

 

 

Documentation that may help can be found here:

 

https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/!FeatureTypeProperties/Merging_Feature_Types.htm

 

https://docs.safe.com/fme/2017.1/html/FME_Desktop_Documentation/FME_Transformers/Transformers/geometryfilter.htm

 

 

I hope that helps.


takashi
Celebrity
  • Best Answer
  • October 23, 2017

Hi @dbklingdom, I would try this.

  1. Read schema features from the target *.shp files with the Schema (Any Format) reader. Expose "fme_geomatry{}" and "fme_dataset" in the "schema" feature type.
  2. Use the Tester to select only schema features having value "fme_point" in the "fme_geometry{0}".
  3. Read the point Shapefile datasets using the FeatureReader with setting "fme_dataset" to the Dataset parameter.

dbklingdom
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • October 24, 2017

How to query schema in FeatureReader for geometry type. I have 12 different schema's and maybe more coming from shapes. i would like to use the Schema's of the points, but cannot seem to get fme_geo or shape_geo in the Schema output to tester.


takashi
Celebrity
  • October 25, 2017

Hi @dbklingdom, I would try this.

  1. Read schema features from the target *.shp files with the Schema (Any Format) reader. Expose "fme_geomatry{}" and "fme_dataset" in the "schema" feature type.
  2. Use the Tester to select only schema features having value "fme_point" in the "fme_geometry{0}".
  3. Read the point Shapefile datasets using the FeatureReader with setting "fme_dataset" to the Dataset parameter.
This screenshot illustrates my intention.

 


redgeographics
Celebrity
Forum|alt.badge.img+62

Hi @dbklingdom, I would try this.

  1. Read schema features from the target *.shp files with the Schema (Any Format) reader. Expose "fme_geomatry{}" and "fme_dataset" in the "schema" feature type.
  2. Use the Tester to select only schema features having value "fme_point" in the "fme_geometry{0}".
  3. Read the point Shapefile datasets using the FeatureReader with setting "fme_dataset" to the Dataset parameter.
A very elegant solution!

 

 


dbklingdom
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • October 25, 2017

Hey many thanks for the replies. Now on the other side how do we setup FeatureReader to output the Schema and data?? If not there I have sent schema to listExploder, but am have trouble setting the schema up to be reader by the Dynamic Writer. IS it a single field? what is the Concatination syntactic? Thx