Questions tagged [matplotlib-basemap]

A library for plotting 2D data on maps in Python

Filter by
Sorted by
Tagged with
0
votes
0answers
17 views

Use ESRI Image Service API in ggmap

I've been using Python Matplotlib Basemap (yes, I know it is being replaced with CartoPy) with the ArcGIS API service to create high-resolution basemaps (e.g., https://www.bdmweather.com/2018/04/...
0
votes
0answers
62 views

Basemap and EPSG 3857

I have my MatPlotLib basemap set up in Mercator projection: map = Basemap(projection='merc', llcrnrlon=-10., llcrnrlat=30., urcrnrlon=36.5, urcrnrlat=46.) I need to create an ...
1
vote
0answers
130 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
72 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 ...
2
votes
0answers
294 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?
2
votes
1answer
642 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
989 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
705 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
340 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
330 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 ...
2
votes
0answers
1k 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
1k 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 =...
7
votes
2answers
3k 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 ...
5
votes
1answer
1k 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
3k 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
654 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
259 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
140 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 current ...
1
vote
1answer
1k 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
14k views

plotting US cities on a map with matplotlib and basemap

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'd like to put a dot on each city, and have the size of ...
1
vote
1answer
54 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
1k 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
535 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
7k 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, ...
1
vote
1answer
981 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
2k views

How to read 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
406 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
139 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
81 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
1k 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
1k 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 ...
2
votes
1answer
3k views

How to plot trajectory points on maps in python

When I read the paper Characterizing Urban Landscapes using Geolocated Tweets, I'm attracted by the figures illustrated in it, like this: And I want to know how to plot these figures for my own data?(...
1
vote
2answers
1k 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
286 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
511 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
249 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() ...
1
vote
0answers
596 views

How to freeze 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
937 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], ...