1

I'm trying to build a simple web application to display service coverage information worldwide. I have been using Datamaps/D3 to build the application. I downloaded the Natural Earth shapefiles for countries and for states/provinces. I am using GDAL and Topojson tools to get JSON data for the app.

The problem is that I would like to get a global map of countries with state/province (aka administrative) borders for the USA ONLY.

I have been trolling around the web for a few hours with no luck. I have downloaded QGIS and working through learning how to do this. But, I figured I would post something here as well.

1

If you're already pulling Natural Earth data, and you're using QGIS, you can do a bit of data processing using the GUI tools in QGIS.

For the Country boundaries, you need to select the USA feature and export it to your desired feature, which I think you want GeoJSON?

The USA Country boundary is in the ne_110m_admin_0_countries layer

If you do an identify of that feature in QGIS, you can see the corresponding attribute value for that feature and the name of the column:

enter image description here

Now using the 'Select feature by expression' tool, build an expression to select that one feature:

enter image description here

click the 'select' button

Then :

  • right-click the ne_110m_admin_0_countries layer choose 'SAVE AS'
  • in the 'Save vector layer as' dialogue box, choose the format you want to save as (GeoJSON), keep the CRS as EPSG:4326, and ensure the 'Save only selected features' box is checked.
  • Click OK and you've got a USA Country Boundary

Do the same thing for the States you're after, and you should be good to go...

  • Thanks! This got me the map I need. I exported the merged map from QGIS at GeoJSON. I converted to Topojson and pull it up in my web app. The state borders are present, but when I roll over the popup says "undefined." I see that the country data and administrative area data have different models. I read a little bit about dissolving the data. I'm lost on how to configure properly. – spdaly Oct 27 '15 at 12:36
  • Oh - which layers did you use the Dissolve tool on? In that tool there is a Dissolve Field option, which should be set to the 'Name' of the feature, which you'll then use in the popup... – DPSSpatial Oct 27 '15 at 13:21
1

You can find current US Administrative boundaries here, if you do not want to bother with pre-processing the data out of a global dataset. TIGER/Line® Shapefiles are issued by US census bureau. But I'm not sure whether they are official or not. I don't know which agency issues the official boundary data may be there is a 'survey and ordnance authority' or something similar.

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.