CSV import of polygon data

New home Forums Pro Add-on CSV import of polygon data

Tagged: ,

This topic contains 10 replies, has 3 voices, and was last updated by  willsss 2 years, 5 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #27184

    willsss
    Member

    Hi, I’m trying to figure out how to consistently import polygon data and have done it successfully once out of about 20 tries, and I’m not sure what was different. The instructions you guys provide are pretty light on detail. It would be nice to have more detail.

    What I’m trying to do is be able to import lat/long data so that I can create a polygon from preexisting data rather than have to create it by hand in the plugin. I’ve created a few successfully, but want to add some more detailed polygons with hundreds of points.

    Every time I’ve tried the import, it’s said it has imported successfully. The last 2 times I tried it, it said it imported but also displayed these messages:
    INSERT INTO wp_7mccipabgg_wpgmza_maps SET map_id = ‘6’ ,polydata = ‘(-73.85531815700239, 41.15328407353488),(-73.84927245788282, 41.16352251350251),(-73.85645495262003, 41.15515663356643),(-73.85546521749353, 41.15354100069705),’ ,linecolor = ‘0’ ,lineopacity = ‘0.5’ ,fillcolor = ’66FF00′ ,opacity = ‘0.5’ ,title = ‘test234’ ,link = ” ,ohfillcolor = ’57FF78′ ,ohlinecolor = ‘737373’ ,ohopacity = ‘0.7’ ,polyname = ‘test2345’ ,innerpolydata = ”

    INSERT INTO wp_7mccipabgg_wpgmza_maps SET map_id = ‘6’ ,polydata = ‘(41.15328407353488, -73.85531815700239),(41.16352251350251, -73.84927245788282),(41.15515663356643, -73.85645495262003),(41.15354100069705, -73.85546521749353)’ ,linecolor = ‘0’ ,lineopacity = ‘0.5’ ,fillcolor = ’66FF00′ ,opacity = ‘0.5’ ,title = ‘test234’ ,link = ” ,ohfillcolor = ’57FF78′ ,ohlinecolor = ‘737373’ ,ohopacity = ‘0.7’ ,polyname = ‘test2345’ ,innerpolydata = ”

    For the import that resulted in the first message above, the Lat/Long coordinates were not in the order that the plugin outputs them (they were reversed), but I wanted to see if it would work. The second time they were in the same order the plugin outputs them. Neither of the imports worked, and I don’t know why. In both cases, when I went to check polygon data, it was blank.

    I gathered for myself that for an import to work correctly, I need to first create the map with the plugin, then use the same map_id in column B in the CSV. I also think I need to use an id in column 1 that is not in use by other polygons. But not sure about that?

    So my questions are:
    1) If I want to import polygon data that wasn’t created in the plugin, does it HAVE to be in this format to work? (41.15328407353488, -73.85531815700239),
    2) What setup do I need to do first? Create a new map and add an unused id and the new map’s map_id in the CSV to match the new map? Or something else?
    3) What else do I need to do to get the import to work? Do you know why my previous imports didnt work?
    4) If I use this option: “Replace existing data with data in file” will it replace all of the map data, or just the data for the specific maps included in the CSV?

    I attached a CSV I used that led to the second message above.

    Attachments:
    You must be logged in to view attached files.
    #27191

    SupportTeam
    Moderator

    Hi there,

    Thank you for getting in touch with us and I apologize for the confusion you have had.

    1) Yes, the polygon data needs to be in the same order that our plugin has it (as you pointed out in your example) you can also try to remove the space between the commas to see if that helps. Usually when importing Polygons or Polylines, it is generally a good idea to first create one by hand and then export it and then you can see how the plugin handles the data and what needs to be in those location points and other columns in the CSV file.

    2) The plugin should be able to work if you are importing the data onto an existing map, if the map does not exist yet (under the map id column) then the markers will not upload to your site.

    3) As mentioned above, please try create a polygon/polyline by hand and then download the CSV file to see the structure of the hand made poly data and then you can easily replicate the import function with the existing sheet. However, please try to open the CSV file in Google Sheets as Excel tends to add extra commas in the fields.

    4) That option will replace all polyline/polygon data on your site so that is best used on a first import and then after that, you can upload the CSV files without clicking to replace the data.

    The attachment seems to have been lost on my side, could you please send it again so I can take a look at this for you?

    Thank you for your time in this.

    #27197

    willsss
    Member
    This reply has been marked as private.
    #27199

    SupportTeam
    Moderator

    Hi Will

    Please send me a link to your map so I can look further into this for you?

    I’ve imported your test polygon from the sheet below onto a map on my local environment and it seems to show as expected, however the map needs to be re positioned and zoomed into for you to see the polygon properly.

    #27200

    willsss
    Member
    This reply has been marked as private.
    #27222

    willsss
    Member

    Anyone able to look into it on my site?

    #27232

    SupportTeam
    Moderator

    Hi Will,

    I do apologize sincerely for this issue on your site.

    I have checked out your Google Sheet and you are trying to display the Polygon on Map ID 7 of your site. I logged in and checked Map and the Polygon was showing in the admin area. I tried to look at your front end map and went to Interactive Map and it appears you have changed the link to Videos and Photos. Attached are screenshots of the map images with the Polygons showing in the admin.

    If you are unable to see the Polygons on the front end of your site, please can you send me a link to your map on the front end of your site and I will check that to see what the issue might be.

    Thank you for your time in this matter.

    #27234

    willsss
    Member

    Looks like attachments aren’t working on the forum right now, I don’t see any. Do you mean this polygon? This is another one in the map, not the one I’m trying to upload.
    05.17.2017-15.32.55

    #27235

    willsss
    Member

    If that’s the only one you see as well, can you try to upload the one I attached in google spreadsheet and tell me why it isnt working?

    #27239

    willsss
    Member

    I hope you guys did something, because now I see it on the back end and I didn’t do anything!

    #27270

    SupportTeam
    Moderator

    Hi Will,

    Thank you for getting back to me on this.

    Yes, we did upload the file to show the Polygon on Map ID 7. As mentioned before, it seems that as soon as you add a Polygon ID to the CSV it does not upload properly.

    If you need anything else, please get back to me and I will be happy to help you.

    If you are all set and you have a few minutes – please consider reviewing the plugin on https://wordpress.org/support/plugin/wp-google-maps/reviews/ – it would mean the world to me!

    Thank you for your time in this.

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.