Skip to main content
Solved

Pass geometry and coordinate system when converting from XML

  • April 3, 2018
  • 1 reply
  • 15 views

aron
Supporter
Forum|alt.badge.img+16
  • Supporter

I am trying to convert a dataset from XML (KuntaGML) to shape but cant get it to behave properly. I am using a dynamic workspace and the output is 80:ish shapefiles. Everything exports but loses its coordinate system and gets is geometry from the first feature read. I have tried adding the desired coordinate system up in the left corner of the workspace but it only seems to be written to half, or so, of the files output. As for the geometry I have tried both "from schema" and "first feature defines geometry" none of them make any difference, everything is output as points, even though all geometries are in the XML.

What am I doing wrong?

Best answer by jdh

You can use the CoordinateSystemSetter transformer on the features directly.

For the geometry issue, that's related to the fact that shapefiles can only support one geometry type. You need to make sure that the different geometry types have different shapefile names. You can do this implicitly with a dynamic schema, or explicitly with a geometryFilter and a different writer feature type for each geometry.

View original
Did this help you find an answer to your question?

1 reply

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • Best Answer
  • April 3, 2018

You can use the CoordinateSystemSetter transformer on the features directly.

For the geometry issue, that's related to the fact that shapefiles can only support one geometry type. You need to make sure that the different geometry types have different shapefile names. You can do this implicitly with a dynamic schema, or explicitly with a geometryFilter and a different writer feature type for each geometry.


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