0

I have scraped a list of postal codes for which I want to extract (lat, lon) data.

In Postal Codes Germany, I was able to extract lat lon for the postal code by is there a way I can for a list of postal codes all at a time?

3
  • 1
    Download download.geonames.org/export/zip/DE.zip create a new df and merge with your data
    – Bera
    Commented Aug 13, 2020 at 11:54
  • With lat lon for the postal code do you mean the coordinates of a geocentoid of PLZ-polygon? Additionally, I may suggest creating a GeoDataFrame out of this data suche-postleitzahl.org/download_files/public/…, then get the centroid (or build you own columns like in this answer) and after merge with your data
    – Taras
    Commented Aug 22, 2020 at 19:14
  • Thanks for the suggestion to extract GPS coordinates based on address/Postcode. However, for Postcodes from same country I can see that different countries appeared in the output file. How do you deal with those postcodes? Commented Sep 8, 2021 at 15:21

1 Answer 1

0

The answer to your question is “absolutely, yes”. Let me explain one way to do it.

First, you will need to prepare an “MS-Excel.csv” file or text file with your postal code data. Within that file, next to each postal code, add the country for those pieces of data.

Note: That step is usually optional if all postal codes are residing in the same region (country) but for the sake of clarity and to make sure the data is absolutely going to be considered only from Germany, this is a good step. So, let’s explore the list: 38440, DEU 66121, DEU 83700, DEU 66706, DEU 54518, DEU 18586, DEU 67146, DEU 83317, DEU 65205, DEU 97688, DEU

Next, save this data on your computer as an “MS-Excel.csv” or just ".csv" type file if you prefer to work with a file for many data lines.

You could experiment with just entering single line or a small list in the white box labeled “Paste/type your content . . . “, but for large files, you will be well advised to upload that data into the orange box labeled “Browse or Drop CSV File Here”. Drop the file there or simply copy paste the content of the zip codes.

Landing page CSV2GEO

Now, import that “MS-Excel.csv” file into the orange box on the front of CSV2GEO app and you should see a window open-up similar the window here:

select address tokens here

Across the top line, you will need to classify each element of the address to instruct the geocoding algorithm to process the data.

In this example, the column starting 38440, select “zip” code, in the next column showing “DEU” select “country”. Don’t worry about data usage. CSV2GEO provides up to 100 free geocode data transformations daily and is very reasonably priced for large data files.

select address tokens here

Note: If your original file had contained only postal codes without an identified country/region, you could have clicked on “Show Advance Settings” and select the desired country, assuming all data was from the same country.

select country before geocoding

Once you have all known data elements (tokens) classified, simple click “Process data”. In this case, the first column selected is “zip code” and the second is “country”.

Now, the first ten rows of data will be processed to provide a sense-check. From this, you will be able to dry-run the validity of the batch to see if it appears to make sense before processing a huge data file. This should provide confidence or time to correct if necessary. Once you get sensible initial results, you are ready to go.

preview first ten geocoded results

Next, click on “Next Step – Get All Data” button. Depending on the size of your batch, it may ask you to pay (if over 100 elements) or continue for free (with a smaller batch file).

Note: If you were not already logged in with email and password, the app will ask you to do that so there is someplace to send your data. Otherwise, your task will be processed and placed inside your work history location where you can download it as a file.

Work History where geocoded data is stored

Once here, you are given a couple of useful options:

  • download your data and enjoy using this data in a file form.
  • download your data and use the “Map it” button.

These options will provide you with either a flat file or open CSV2GEO interactive map system that will show you the results from geocoding. These options are both available to you and free for the first 100 rows each day as a CSV2GEO subscriber. Other map manipulations are also possible if the basics of this app are of interest. Please, feel free to ask about specific interest and intent.

CSV2GEO Interactive Map

Disclaimer: Founded CSV2GEO Batch Geocoder

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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