Questions tagged [matplotlib-basemap]

A library for plotting 2D data on maps in Python

Filter by
Sorted by
Tagged with
1
vote
0answers
25 views

Plotting city locations on Python 3 [closed]

My question is a follow-up of this: plotting US cities on a map with matplotlib and basemap. I would like to use some Python library to plot on a map city locations, starting from a list like this: ...
1
vote
0answers
16 views

Getting the coordinates of the points inside of a shapefile/Getting the coordinates of the closest point if there are none

I'm working with an ERA5 (0.25x0.25 degree) temperature dataset for Europe in order to get average temperature in small statistical regions called NUTS 3. So far I've used a shapefile of the NUTS 3 ...
1
vote
1answer
122 views

Display GeoTIFF single band image in Python

I have a single band GeoTIFF image which displays correctly in QGIS. However I tried viewing the same file using matplotlib and rasterio but I get a different output. Is there something that I am ...
0
votes
0answers
165 views

Issue while using “Zoom to Rectangle” in Basemap Matplotlib

I am using the following code to plot the Basemap map on entire tkinter canvas. The code is as under: from tkinter import * from tkinter.ttk import * import numpy as np from matplotlib.figure import ...
0
votes
0answers
173 views

Matplotlib Basemap how to set EPSG to be consistent with new version of pyrpoj

I am getting a Matplotlib Basemap error related to pyproj and setting the EPSG. (I know Basemap is being depreciated, but this is what I am working in for now.) As a result, I can't plot the ...
0
votes
0answers
33 views

When I get the total bounds of a shapefile, which are llcrnrlon, llcrnrlat, urcrnrlon, and urcrnrlat? Need it to use Maptlotlib Basemap

The goal is to use an ESRI webmap as a basemap beneath a shapefile for a script that visualizes earthquakes in the Philippines. But first, I'm practicing in using Basemap in a separate script. ...
1
vote
0answers
276 views

Shapely “parallel_offset” with distance in meters from Lat/Lon coordinates

I need to find a LineString at a distance in meters from a line with coordinates in Lat/Lon. I am trying this approach based on what i found in this question https://stackoverflow.com/questions/...
2
votes
0answers
79 views

Plotting Geopandas Gallery example fails?

I have been having trouble getting the figures from the example provided in Geopandas Gallery examples. When I ran these scripts in Jupyter console: import geopandas import geoplot import matplotlib....
1
vote
0answers
168 views

Basic Python plotting [closed]

Sorry if I sound like I don't understand, but I've been reading around trying to figure out how to do geospatial plotting in Python. I keep running into errors despite the examples I've seen appearing ...
1
vote
1answer
122 views

Shifting data from a GRIB2 file

I have successfully opened a grib2 file from NCEP and I am having trouble being able to convert the coordinates to plot them using matplotlib, using the custom convertXY function from this post Plot ...
3
votes
0answers
1k views

draw map scale in geopandas

Is there a geopandas version of basemap's m.drawmapscale function? If not, can I somehow utilize basemap's drawmapscale function within geopandas?
3
votes
1answer
1k views

Spreading/dispersing overlapping points?

I have a set of 150 sites globally, and I want to map them, and colour by a given variable. Unfortunately they are very non-uniformly distributed, with many of them in small clusters of only a few ...
1
vote
0answers
1k views

Plotting Shapely polygons on basemap

I have some polygons and multipolygons created using latitudes and longitudes using shapely(there is no shapefile). I want to plot them using basemap. However they don't show up. When I use matplotlib ...
1
vote
1answer
1k views

Can't import shapefile in Python

I am trying to plot district boundaries on a map of Nepal. For that I downloaded a shapefile of districts in Nepal from this site: http://www.arcgis.com/home/item.html?id=...
2
votes
0answers
546 views

All contours are not getting converted to shapefile in python

I am trying to create isoline plot for a weather parameter. Inputs are Lat, Lon and Value. They are read from csv file. When I plot the contours using matplotlib, the code works fine and generates ...
0
votes
0answers
479 views

Plot BNG grid data on Matplotlib Basemap

I would like to plot UK population density data in Matplotlib Basemap. I got data in ESRI ASCII using BNG OSGB63 from https://catalogue.ceh.ac.uk/documents/61f10c74-8c2c-4637-a274-5fa9b2e5ce44 and ...
3
votes
1answer
3k views

Smoothing the contour line in Python?

I used the NCEP 2.5 degree*2.5 degree data to plot the 850 mb wind field and heights. But, I didn't know how to smooth the contour line. Scipy.ndimage.zoom didn't work well and some details are missed....
2
votes
1answer
2k views

Masking land with matplotlib basemap in Python?

I've been trying to mask land with .is_land from mpl_toolkits.basemap. When running following code: map = Basemap(llcrnrlon = 7.298914095230308, llcrnrlat = 58.98235690451632, urcrnrlon =...
9
votes
2answers
5k views

Checking if a geocoordinate point is land or ocean?

I got the corner geo coordinates from a xml product file of a Sentinel-1 GRD SAR image. When looping through the pixels of the image I wish to check whether it represents land or sea. I figured I ...
7
votes
1answer
2k views

Unable to load a shapefile with Basemap

I'm try to load this shapefile with Basemap in order to plot it in Python: http://geodata.gov.gr/en/dataset/periphereies-elladas/resource/7c80a2c1-93b7-4814-9fc4-245e775acaa6 But I get the following ...
0
votes
2answers
5k views

Using Google Maps image as layer with Matplotlib Basemap?

I have produced a heat map of assaults in Sydney by suburb. However, my map looks a bit plain and I'd like to do something fancier - I'd like to use a Google Maps image as a background layer - I haven'...
2
votes
2answers
857 views

How to interpolate data using basemap?

I have been trying for a long time now to make this simple basemap work. However, there is something with the format of the data basemap expects, which I cannot figure out. Can anybody help me ...
3
votes
0answers
349 views

Raster flipping latitude or not showing shapefile on basemap

I am trying to save a 2D numpy array as a raster, and then split the raster using shapefiles. When I create the raster, I either have the problem of the latitude being flipped upside down, or that the ...
1
vote
0answers
147 views

Creating neat map in basemap using simplified boundaries?

Is it possible to create a neat map like using basemap (mpl_toolkits.basemap)? I am particularly curious to know if there's a way to "simplify" the boundaries as they are rather edgy in the ...
1
vote
1answer
2k views

Get map from OpenStreetMap and use it as a background with basemap

I want to take a bounding box, use the OpenStreetMap API and get a tile, then use it as a background in basemap. This should be easy, but I haven't been able to figure out the API.
4
votes
2answers
20k views

Get lat-long of US cities and plot them on a map using matplotlib and basemap [closed]

I am hosting a conference and want to show a map of where the attendees have arrived from. I have an input file with the names of the cities. I would like to put a dot on each city, and have the size ...
1
vote
1answer
72 views

Matching Python and GRASS projection

I have a colleague producing maps with the following Python Basemap projection: from mpl_toolkits.basemap import Basemap m = Basemap(width=6000000,height=3900000, resolution='l',projection='...
1
vote
1answer
2k views

Plotting classification map using shapefile in matplotlib?

"I have been struggling with python map plotting since past few days. I have realized that one can use python for plotting comparatively easy maps, but when one has to display detailed information, it ...
2
votes
0answers
729 views

Raster and shapefiles are not overlapping in matplotlib?

I plotted a raster map using matplotlib. When I overlay a shapefile, the raster seems to be shifted a bit. The same raster and shapefile overlap each other perfectly in ArcGIS. Here is what I am ...
8
votes
1answer
10k views

Plotting raster maps in python?

I am trying to plot raster map using Pyhton. Image is not being saved, though it appears. Moreover, pixels are not appearing on the exact place. I am getting image as shown below (which is WRONG, ...
2
votes
1answer
2k views

Hide meridians and parallel lines from plot and add TICK marks in matplotlib?

I want to hide the meridian and parallel lines from my plot and add the tick marks. I could remove the lines by setting linewidth=0, but how to add the tick marks with each Lat-Lon label. meridians =...
1
vote
0answers
3k views

Reading shapefile faster using Python basemap (and pickle)

I am trying to plot a simple 'merc' map with boundary from shapefile. The total size of the shapefile ne_10m_admin_0_countries_lakes.shp is just 8mb. The simple mslp surface plot from GFS data took ...
2
votes
0answers
520 views

Grid parameter restriction of mpl_toolkits.basemap.maskoceans

I have plotted the image below with the use of matplotlib and mpl_toolkits.basemap. However I am not satisfied with the result. The image is still very blocky near the coast line. The grid parameter ...
0
votes
0answers
160 views

Number of polygons in shapefile too high

I downloaded administrative shapefiles from www.gadm.com/country (China). The Python (Basemap) code below tells me that there are 2365 polygons in it. However the .csv and .dbf files included with the ...
0
votes
1answer
2k views

Why do pyproj and matplotlib basemap produce different results when they convert my lat-long data into a CRS?

pyproj and matplotlib basemap seem to produce differing x-y values when they convert my lat-long data into the same CRS (such as Albers Equal Area). These x-y values tend to be off by hundreds of ...
1
vote
1answer
1k views

Adding map from website maps-for-free.com as basemap on QGIS?

How can I add map from maps-for-free.com as my base map on QGIS 2.10 Pisa? My operating system is Windows 7, x64 bit. @Spacedman. Here, I've gone to ~/.qgis2-->python-->plugins-->quick_map_services-...
1
vote
0answers
94 views

Matplotlib Basemap Coastal Coordinates

Is there a way to query basemap to extract all coastal coordinates? Say user provides lat/lng and the function returns true/false if the coordinates are within 1km from the coast? Links are more than ...
1
vote
0answers
2k views

Using arcgisimage along with python basemap

I am utilizing maps provided through the ArcGIS rest service when i plot information in Python, but have some problems understanding the different options I have when I request I map. The ...
0
votes
1answer
2k views

Shapefile projection for Matplotlib Basemap

Preface: First time working with GIS data. I'm using python's Basemap library for overlaying data on maps. The tutorial I'm using includes a shapefile for London (london_wards.shp). I use the ...
1
vote
2answers
2k views

Why can't Basemap's readshapefile read the world_adm0 shapefile?

I'm using the world shapefile that can be found at https://trac.openstreetmap.org/browser/applications/editors/merkaartor-branches/merkaartor-0.14-fixes/share/world_shp/world_adm0.shp?rev=17052. ...
1
vote
1answer
1k views

Python Basemap fails

I am using Anaconda 2.1.0 and Basemap installation is successful conda install basemap However, I keep getting the following error when I try to project lat,lon to a planar: Assertion failed: (0), ...
2
votes
1answer
411 views

QGIS: how to combine a GeoTIFF with a country border shapefile?

I have two files. A GeoTIFF with different values and a shapefile with country borders of this area. Can I generate with these two files an image with the country borders and the data from the GeoTIFF?...
1
vote
0answers
547 views

How to update country borders in matplotlib.basemap?

I'm using basemap-1.0.7 and generated an image of Africa with the drawcountries() method. The border between Sudan and South Sudan is missing. Does someone know how to update this country borders?
1
vote
1answer
287 views

how to transfer a geotif with WGS84 to a mercator array for ploting it with matplotlib.basemap

I want to plot data from a sensor raster file (tif) to a map using basemap. I have a geotif with 'WGS 84' >>> gtif = gdal.Open("example.tif") >>> print gtif.GetProjectionRef() ...
0
votes
0answers
702 views

Freezing basemap using cx_freeze

I am working on script and I´d like to freeze it for use in computers who haven´t got python installed- The script is running fine but when I freeze it using cx_freeze an error appears. at the end ...
1
vote
1answer
1k views

Orthographic projection in Python Basemap

I'm trying to plot a GeoTIFF in Python using Basemap. I can do so correctly with cyl projection like this: m = Basemap(projection='cyl', llcrnrlat=LL[1], urcrnrlat=UR[1], ...