0

I want to use QGIS to write polyline coordinates in a file. I did already successfully created .shp file. But It is hard to code(in C#) to fetch the coordinates. I need to fetch the coordinates in my tool to perform different calculations. QGIS is a very easy and free way to avoid creating a gui just of creating polyline files.

  • Please edit your question to contain an explicit question. Questions about coding are expected to have code in them, with as far as you have gotten, and details about where you need to go. – Vince Jan 7 '16 at 2:02
0

I think GeoJSON would be your best format.

If you want to host it online and use a web gui to make your edits, there is GeoJSON.io

https://github.com/mapbox/geojson.io

But if you want to stick to QGIS desktop, I think you're going to have to use a .SHP to create and edit your lines (or PostGIS if you've got the banwidth), then convert the .SHP to GeoJSON (right-click layer, save as, choose GeoJSON format, coordinate system - which will work with a PostGIS layer in QGIS as well...). That's a manual way to do it, but you might script it somehow as well...

  • Why couldn't a csv output with the polyline coordinates as WKT be an option? I've put this as a comment as I've no knowledge of C#! – Andrew Tice Jan 7 '16 at 10:49
  • @AndrewTice I tried this last night but couldn't get it to work ... let me try again... – DPSSpatial Jan 7 '16 at 14:01
  • @AndrewTice trying this again, I can create a CSV with WKT geometry type, and although I can start an edit session and create a new line, QGIS doesn't give the option to save, and when you try and stop editing and save, the new feature doesn't get committed to the CSV... are you getting it to work? – DPSSpatial Jan 7 '16 at 14:05
  • Australian time, sorry! Wouldn't the same thing happen with GeoJSON? You'd have to commit the changes to the file and do a "save as" in both instances. My initial comment was more about the OPs ability to generate a file format that could be easily read in C#. A flat file seemed more useful. – Andrew Tice Jan 7 '16 at 20:53
  • 1
    ...and neither do I! I think we should stop this now...before we get moderated! – Andrew Tice Jan 7 '16 at 22:34

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.