1

I am looking to convert XML to shapefiles using FME.

The XML files are user generated while they draw points and lines (mainly) of interest on a web map. We generate the XML in the background containing the spatial information of user clicks.

I would like to ask whether we need to follow a specific format during XML generation so as to proceed to converting them to shapefiles using FME.

Here is an XML snippet

<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
 <Note>
  <NoteTypes>
   <Type Desc="Point:a" Id="0"/>
   <Type Desc="39.66195294811828" Id="1"/>
   <Type Desc="20.84663271903992" Id="2"/>
  </NoteTypes>
 </Note>
 <Note>
  <NoteTypes>
   <Type Desc="Point:b" Id="0"/>
   <Type Desc="39.6634561263267" Id="1"/>
   <Type Desc="20.84773778915405" Id="2"/>
  </NoteTypes>
 </Note>
 <Note>
  <NoteTypes>
   <Type Desc="Point:c" Id="0"/>
   <Type Desc="39.66210161555193" Id="1"/>
   <Type Desc="20.8490788936615" Id="2"/>
  </NoteTypes>
 </Note>
 <Note>
  <NoteTypes>
   <Type Desc="Line:l1" Id="0"/>
   <Type Desc="39.66206857837209" Id="1"/>
   <Type Desc="20.84651470184326" Id="2"/>
   <Type Desc="39.66291928072009" Id="3"/>
   <Type Desc="20.84694385528564" Id="4"/>
   <Type Desc="39.66319183362618" Id="5"/>
   <Type Desc="20.84708333015442" Id="6"/>
   <Type Desc="39.66352219934388" Id="7"/>
   <Type Desc="20.84763050079346" Id="8"/>
  </NoteTypes>
 </Note>
 <Note>
  <NoteTypes>
   <Type Desc="Line:l2" Id="0"/>
   <Type Desc="39.66354697670904" Id="1"/>
   <Type Desc="20.84759831428528" Id="2"/>
   <Type Desc="39.66295231749322" Id="3"/>
   <Type Desc="20.8476734161377" Id="4"/>
   <Type Desc="39.66248980123196" Id="5"/>
   <Type Desc="20.84869265556335" Id="6"/>
   <Type Desc="39.66220072699667" Id="7"/>
   <Type Desc="20.84896087646484" Id="8"/>
  </NoteTypes>
 </Note>
 <Note>
  <NoteTypes>
   <Type Desc="Line:l3" Id="0"/>
   <Type Desc="39.66203554117646" Id="1"/>
   <Type Desc="20.84653615951538" Id="2"/>
   <Type Desc="39.66141609083402" Id="3"/>
   <Type Desc="20.84785580635071" Id="4"/>
   <Type Desc="39.66219246771504" Id="5"/>
   <Type Desc="20.84893941879272" Id="6"/>
  </NoteTypes>
 </Note>
</Configuration>
  • Does it have to be XML for Web Mapping (geo)JSON would be more efficient. geojson.org/geojson-spec.html – Mapperz May 20 '14 at 13:38
  • Our Desktop software produces xml files, most of the functionality is already developed. Will FME handle concversions from XML to shp or geoJSON is the only alternative? – Nik May 21 '14 at 7:10
  • 1
    Well, yes FME is able to convert nearly any format to a shapefile. But it depends on the structure/schema of your XML. Asking if it is possible to read XML is like asking if it is possible to read database or simply a text file. Please be more specific about the schema/structure of the XML. How would you like to store coordinates? Where are the attributes? Parsing XML can be tricky, if the structure does not fit common standards. Perhaps you can post a snippet of your XML data here. – Jürgen Zornig May 21 '14 at 11:02
  • Just added an XML snippet – Nik May 21 '14 at 12:05
  • Is <Type Desc= a distance or coordinate? – Mapperz May 21 '14 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.