gdal

How to run GDAL (ogr2ogr) in Java to convert Shapefiles to GeoJSON

霸气de小男生 提交于 2019-11-29 14:09:38
问题 I'm a beginner at programming and get pretty confused when trying to use external libraries. I have my maps in shapefiles that I convert to GeoJSON using the website Mapshaper.org, and only then can i read the map from my Java application. I want the user to be able to import a shapefile directly so I found out about GDAL ogr2ogr that has Java bindings, and can make this conversion with a single command such as: $ ogr2ogr -f GeoJSON -t_srs crs:84 [name].geojson [name].shp but I have no idea

How do I write/create a GeoTIFF RGB image file in python?

和自甴很熟 提交于 2019-11-29 13:33:57
问题 I have 5 numpy arrays of shape nx, ny lons.shape = (nx,ny) lats.shape = (nx,ny) reds.shape = (nx,ny) greens.shape = (nx,ny) blues.shape = (nx,ny) The reds, greens and blues arrays contain values that range from 0–255 and the lat/lon arrays are latitude/longitude pixel coordinates. My question is how do I write this data to a geotiff? I ultimately want to plot the image using basemap. Here is the code I have so far, however I get a huge GeoTIFF file (~500MB) and it comes up blank (just a black

can't import gdal in python?

廉价感情. 提交于 2019-11-29 09:35:27
I have gdal installed and running on Ubuntu Jaunty but I can't run gdal2tiles because I get the error: Traceback (most recent call last): File "/usr/local/bin/gdal2tiles.py", line 42, in <module> import gdal ImportError: No module named gdal When I open python and type import gdal I get the same error. I've set LD_LIBRARY_PATH (without spaces!) to /usr/local/lib but it doesn't seem to have made any difference. Looks like Python can't find gdal . Can anyone help? Thanks! Ith seems to be a " Python Path " issue. Python libraries are looked-up within a defined path. Try import sys sys.path If the

GeoDjango on Windows: Try setting GDAL_LIBRARY_PATH in your settings

人盡茶涼 提交于 2019-11-29 09:34:26
问题 I've done this a dozen times before, but something isn't working this time.. Following the docs: https://docs.djangoproject.com/en/1.11/ref/contrib/gis/install/#windows I'm trying to set up GeoDjango on a Windows machine (this one is a virtual windows 10 set up on paperspace.com). There seems to be a problem with my PATH settings, but I can't figure out what it is. I've run the commands highlighted in the instructions. I've checked my PATH variables and everything seems ok. I've tried

D3js: How to design topographic maps?

时光总嘲笑我的痴心妄想 提交于 2019-11-29 08:15:49
问题 Given a GIS raster with elevation data, How to design a topographic map in D3js ? Is there any example of relief / topographic maps of cropped lands made using D3js ? Not working: I explored the posibility of .tif > gdal_contour.py > .shp > topojson > d3js without success. I use a makefile which contain all my commands. As my area of interest (France) is a crop of land areas, the gdal_contour.py approach generates broken isolines which does NOT create closed polygons. Also, the SVG end result

Downsample array in Python

百般思念 提交于 2019-11-29 05:05:18
问题 I have basic 2-D numpy arrays and I'd like to "downsample" them to a more coarse resolution. Is there a simple numpy or scipy module that can easily do this? I should also note that this array is being displayed geographically via Basemap modules. SAMPLE: 回答1: scikit-image has implemented a working version of downsampling here, although they shy away from calling it downsampling for it not being a downsampling in terms of DSP, if I understand correctly: http://scikit-image.org/docs/dev/api

Plot GDAL raster using matplotlib Basemap

笑着哭i 提交于 2019-11-28 17:59:34
I would like to plot a raster tiff ( download -723Kb) using matplotlib Basemap. My raster's projection coordinates is in meter: In [2]: path = r'albers_5km.tif' raster = gdal.Open(path, gdal.GA_ReadOnly) array = raster.GetRasterBand(20).ReadAsArray() print ('Raster Projection:\n', raster.GetProjection()) print ('Raster GeoTransform:\n', raster.GetGeoTransform()) Out [2]: Raster Projection: PROJCS["unnamed",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY

Incorporating GDAL/OGR into an iOS project - A quick guide

瘦欲@ 提交于 2019-11-28 17:40:27
Here is the problem: GDAL is a fantastic open source library designed to manage complex GIS data, both raster as well as vector. It is fully compiled for the Mac OS (courtesy of William Kyngesburye) and other platforms but not for iOS. Browsing the net you can find bits and pieces of (relatively old) information on the topic of creating an iOS library, starting with the famous script from pseudogreen which was written over 3 years ago. There are also bits and pieces on stack-overflow such as GDAL / OGR on the iPhone which provide additional information. This article is meant to cover all the

Obtain Latitude and Longitude from a GeoTIFF File

老子叫甜甜 提交于 2019-11-28 15:23:30
Using GDAL in Python, how do you get the latitude and longitude of a GeoTIFF file? GeoTIFF's do not appear to store any coordinate information. Instead, they store the XY Origin coordinates. However, the XY coordinates do not provide the latitude and longitude of the top left corner and bottom left corner. It appears I will need to do some math to solve this problem, but I don't have a clue on where to start. What procedure is required to have this performed? I know that the GetGeoTransform() method is important for this, however, I don't know what to do with it from there. fmark To get the

Trouble installing rgdal

对着背影说爱祢 提交于 2019-11-28 05:22:35
I want to install rgdal for "R version 3.2.3 (2015-12-10)" . I downloaded and installed GDAL 1.11 Complete PROJ framework v4.9.2-2 GEOS framework v3.5.0-1 from KyngChaos Then in RStudio I typed install.packages("rgdal") which gave me this: > .... > > configure: CC: clang configure: CXX: clang++ configure: rgdal: > 1.1-1 checking for /usr/bin/svnversion... yes configure: svn revision: > 572 checking for gdal-config... > no no configure: error: gdal-config > not found or not executable. ERROR: configuration failed for package > ‘rgdal’ > * removing ‘/Library/Frameworks/R.framework/Versions/3.2