Export to mysql geographic format
mrpurple
Global Mapper User
I've been trying to export a bunch of polygons to a mysql ready format.
MYSQL can read in polygons with the following code:
Is there an easy way to output polygons in a mysql ready format?
MYSQL can read in polygons with the following code:
INSERT INTO table_name (column_name) VALUES(PolygonFromText('POLYGON(( 174.9128580500 -41.1331256333, 174.9131912500 -41.1330434500, 174.9134643167 -41.1332534167, 174.9136826167 -41.1332937500, 174.9128580500 -41.1331256333 ))'));So I can export my polys as simple_ascii files using the header and footer from the above example as the feature seperator then with a little fenagleing of the output file using a couple of dos batch files (which I'm happy to post) to add a comma at the end of each coordinate line and then manually editing the overall header and footer to produce a mysql ready input file. Unfortunately this fenagling process is painfully slow and requires a manual step - just to add a comma. So my question is:
Is there an easy way to output polygons in a mysql ready format?
Comments
-
shoot too late to edit: I should also add that I also still need a way to remove the last added comma. eg by having the option to append the feature seperator directly to the end of the last coordinate and not to a new line. Its a shame that's not already the standard behaviour since adding back the new line would be as simple as starting your feature seperator with \n
-
While there's not currently a way to do that, one of the things that we are adding is built-in support for several different types of databases for the upcoming v14 release, so things like this should be much easier in the near future.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.globalmapper.com -
Is there any way to export to a sql file instead of having to connect to a database through the program? I'd like to export in sql format and import into my database through something like phpmyadmin.
-
So would the export be the same as the text above, or can you import from some other format, like perhaps a CSV file with WKT coordinate strings for area and line features?
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.bluemarblegeo.com/
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website