Need to create country specific poi-files from one big poi file.

 

Hello all!
First post here so please bear with me and be gentle smile.
Just installed Sygic Car GPS on my head unit and was going to import pois. Only to discover that Sygic only accepts one poi file for each country.
Problem is my file covers Europe. And it has no country metadata only coordinates and description.
So I need based on the coordinates to filter and create separate files for each european country (and then convert to sygic rupi format).
This bad support for poi in sygic was an unpleasant surprise. Should have done my homework better. But having paid licence I figure I should try to get this working.

I have done some searching and found some POI-software but have not managed to figure out if and how to separate to countries and export.

Hope someone here can assist. Thanks in advance!

Welcome

I assume you have a way to read this file.

Let's start by you giving us, say, 5 entries from the file so we can better understand what you are dealing with.

i thought

jgermann wrote:

I assume you have a way to read this file.

Let's start by you giving us, say, 5 entries from the file so we can better understand what you are dealing with.

I thought his statement was fairly clear. His file has 3 entries per record - Lat, Lon, and a description but no identifiable data on where the point is as far as country.

--
Illiterate? Write for free help.

only know how to do it manually

Assuming this is a comma delimited text file:
Open your POI file in Excel and copy and paste the L/L (A & B columns) into the input box in the upper left of Google Maps. Depending on the file format, you may have to switch the L/L for Google.

Then copy and paste the location/country into the "D" column (4th).

Repeat for each line.

If you don't have MS Excel, D/L Open Office (it's free) and use the spreadsheet to populate the 4th column and to sort by country.

There may be a program out there that returns a country, but I'm not aware of it.

What happens if you enter all the locations as one country?

You may want to read my FAQ on using MS Excel to sort a POI file. It's rather lengthy, but it's for Beginners & Experts. Something there may help you out.
http://www.poi-factory.com/node/50601

How many lines/entries are in the file?

--
Metricman DriveSmart 76 Williamsburg, VA

How “big” is big?

In the original problem statement the OP uses the term “big’. https://www.latlong.net/Show-Latitude-Longitude.html will convert latitude and longitude to a street level address thus yielding country but it is singular entry. Hopefully there aren’t hundreds of entries.

--
John from PA

It has 6500 entries

Thanks for responding, guys!
The file has about 6500 entries so I rather not do a manual country search for each position.
Here is the first couple of rows from the csv version of the file:

Longitude,Latitude,Name,Address
14.671778,56.152417,Pukavik - Rastplats,Pris: 0.00 SEK - 2006-07-28 | Kassettömning WC HCP Sopor
15.006722,56.20525,Åryd - Rastplats,Pris: 0.00 SEK - 2006-07-28 | Kassettömning WC HCP Sopor
14.865195,56.165135,Östra Piren Karlshamn - Ställplats,Pris: 0.00 SEK - 2020-02-06 | WC | Centrumnära

There is also a kml-version of this file and looking at the code in an editor there is a country parameter. I haved tried to parse from that kml into excel using xml-mapping but cannot get it to work all the way. Seems as if the kml is not entirely correct for an xml-mapping.

So I was hoping for some way to split the csv based on the coordinates.

Your three samples are in the Arabian Sea

The three samples you provided are in the Arabian Sea. Is this typical of all your points, not being land based coordinates? Not being land based adds the complexity of knowing a countries defined international border.

--
John from PA

They are listed with longitude first

If you change order you´ll end up in Sweden. That file has longitudes before latitudes smile. Dunno why it´s compiled that way. Not done by me.

Duh

Duh, it even says that("Longitude,Latitude,Name,Address"). Sorry.

With 6500 entries I'm at a total loss of how you would accomplish this except what you've tried, the kml-version mapping to xml-mapping. Can you maybe break the csv file down into something much smaller and then retry the mapping? If that would work, then reassemble the "pieces".

--
John from PA

L/L is reversed

If you swap the L/L and enter them into Google Maps, you wind up in Sweden. Text on map matches text in file.

Another obstacle to overcome. But it can be done easily in Excel.

--
Metricman DriveSmart 76 Williamsburg, VA

YouTube, worth a look

There is a YouTube video at https://www.google.com/search?safe=active&sxsrf=ALeKk02IvQyn... that if you go about 1:40 in you'll find steps to convert latitude and longitude to location. Not sure if that would help but it may be worth a look.

The first part of the video is using location to lat/long and the 2nd part, again at about 1:40, is the reverse, lat/long to location.

--
John from PA

Thanks for that pointer,

Thanks for that pointer, John!
But please post a direct url to that specific youtube video (the google search lists quite a few)

But among the search hits I actually found a working solution, sort of. This turkish guy has piece of php code that uses googles geolocaton api.

https://www.youtube.com/watch?v=ho-YuDI3v04

With my limited coding skills I could get it to locate these coordinates:

56.152417, 14.671778

To print out this:

"Vikaljungavägen 1802, 294 93 Sölvesborg, Sweden"

Which is correct!

Now I just wish my coding skills were better so I could produce a function/loop that could run through all those 6500 lines and print ut the adresses smile

Note: I also found a nifty xcel plugin that does the above but that was a bit pricey, unfortunately.

Here's the link

T68 wrote:

Thanks for that pointer, John!
But please post a direct url to that specific youtube video (the google search lists quite a few)

Sorry; give this a try again take note the reverse geocode is at about 1:40. https://www.youtube.com/watch?v=UCo43PXFdb8

A comment at the bottom makes me wonder if you need something in addition; some Excel add-in. Perhaps even what you found to be pricy. Can you get the job done with the 30-day trial?

Quote:

Excel geocoder at http://www.cdxtech.com/cdxzipstream provides latitude and longitude data, reverse geocoding, and distance calculations. It works with either the Bing Maps web service or Microsoft MapPoint Try a free 30-day no-risk trial.

If you go to that link, make sure you expand all the comments at the bottom.

--
John from PA

Thanks, may try that

Ah, that was the excel-plugin I referred to that I found before!
It looks really handy and I may try the free trial. But I rather find a solution that I can use every time the big master file is updated (which is maybe once a month) so that would mean purchasing license.

Another update on this: turns out I have a coworker that is pretty handy with php and he is goint to try to help me code a function that will reverse geocode the big file with all the coordinates. I have my fingers crossed he will succeed smile.

VBA script

There is a VBA script at https://www.ilovefreesoftware.com/07/tutorial/how-to-reverse... that will supposedly do it.

--
John from PA

Why buy software

In Excel it's easy to reverse the L/L columns.

Right click on the "A" column tab at the top.

Select "Insert" in the dropdown. A new empty column "A" will appear.

Copy contents of column "C" (formerly "B") into column "A".

Delete column "C".

Save with new file name.

--
Metricman DriveSmart 76 Williamsburg, VA

Reverse columns is not the issue. Need reverse geocode

Hi!
Yes I understand how to switch the columns. That is not the issue. What I´m looking for is to generate country information from the coordinates.

I tried the VBA - script suggested (thanks) but unfortunately i get an value error running it. Have reached out to the developer to see if I can sort that out.

Found a similar excel based setup but that wont work either.

My friends php-coding is also not running on my server.

The struggle continues smile!