I have a shapefile of the US (5m resolution from the US Census Bureau), but I need the entire globe except for the US. To do this, I opened the shapefile (which I will call usa_layer) in QGIS, and then added a rectangle for the entire globe:

Vector > Research Tools > Polygon from layer extent

I then added a buffer to make sure that the shape would include the poles:

Vector > Geoprocessing Tools > Fixed distance buffer
Input layer: extent_layer
Distance: 10
Segments: 5

Next, I took the difference of usa_layer and extent_layer:

Vector > Geoprocessing Tools > Difference
Input layer: extent_layer
Difference layer: usa_layer

The resulting layer looks like this:

Difference layer

This is what I was going for. However, when I right-click this layer and Save As... a KML, that layer looks like this:

KML layer

Obviously, this is not the same as the difference layer. When I show this layer on my Google map, I see this:

enter image description here

This is even worse. It seems as if the edges that were not present on the KML layer (blue) but were on the difference layer (purple) are the only ones shown. Comfortingly, on the right of this sort of capsule shape, one can see that Alaska is indeed cut out of it as intended.

Why is this weirdness happening, and how can I fix it?

  • What was the distance for your buffer? Perhaps since your rectangle encompasses more than the entire area of the "flattened" earth, the edges are being lost. – Kingfisher Jan 3 '18 at 14:15
  • @Kingfisher, just 10. Do you know why only the left and right edges are being shown? Interestingly, the part that is shown to be clipped off is the only area shown. – Daniel Jan 3 '18 at 14:21
  • @Kingfisher, even if I add no buffer, the same semi-capsule results just 'unbuffered' by 10. I added the source of the shp file to the top of my question in case that helps. – Daniel Jan 3 '18 at 14:41

Your problem lies in the fact that you are buffering a layer whose X extents are -179 and +179 degrees. So what you are basically doing is extending the left and right edges in a way that if you would drape the resulting layer on the globe, you would have an overlap. What you should do instead is first reproject the input layer from NAD83 to WGS84 and create the extent layer. After creating the extent layer, edit the top left and right vertices by using the node tool and typing the Y coordinate that you need, thus preserving the X extent. You should not use the buffer tool.

Note: In your third step (difference), I believe you meant buffer layer instead of extent layer.

  • Interestingly, even if I do not add the buffer, it still gets clipped. Is that happening for the same reason as you described in your answer? – Daniel Jan 4 '18 at 11:01
  • I forgot to add a step in my answer, which is reprojecting the original data from NAD83 (EPSG 4269) to WGS84 (EPSG 4326), which is the CRS used in KML files. – Techie_Gus Jan 4 '18 at 11:46
  • When I do not edit the extent at all, the layer still gets clipped. Any idea why this still happens? – Daniel Jan 4 '18 at 14:25
  • Not sure what is happening at your end, but when I try the steps I outlined, clipping does not occur. Can you explain what you're doing and at which step is the clipping happening? – Techie_Gus Jan 4 '18 at 19:24
  • Video of process: dropbox.com/s/6ptm8chnj6yubae/… Photo of result rendered in Google Earth (done immediately after the video ends): dropbox.com/s/5n9ivcpo6y98bn5/google%20earth%20render.png?dl=0 Photo of result rendered in Google Maps (done immediately after Google Earth photo taken): dropbox.com/s/evozxhc3bpey30j/google%20maps%20render.png?dl=0 – Daniel Jan 5 '18 at 1:11

Try it with importing the original ESRI shapefile to Google Earth Pro:


The holes can be problematic in KML. See these posts:



And the exceed of WGS-84 ellipsoidal coordinate limits [-180, 180, -90, 90] can be also problematic.

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.