Tag Info

New answers tagged

0

I suggest not to create such a matrix, which could be quite inefficient, but if you really need this, you create an ascii file with Long, lat, and value as columns, (which you can import in Matlab.) gdal_translate -of XYZ input.tif output.asc gdal is also available from qgis as a plugin (with a GUI), but you can use it directly as a command line. Note ...


0

Gene's answer pointed me in the right direction. The simple answer seems to be that the data in PostGIS is in Web Mercator (EPSG 3786) and so if I want lat/long it needs to be re-projected (or de-projected...), with an SRID like EPSG 4326. call (["ogr2ogr", "-f", "GeoJSON", record[1] + ".json", 'PG:dbname=\'gis\'', "-sql", 'SELECT ...


2

OpenLayers uses the EPSG:3857 coordinate system, in meters, and not the WGS84 system, in degrees, look at OpenStreetMap Wiki: EPSG:3857 But why use subprocess and ogr2ogr? 1) you can use directly the PostGIS ST_AsGeoJSON function: import psycopg2 conn = psycopg2.connect("dbname='osm' host='localhost' user='me'") cur = conn.cursor() # srid of the layer ...


5

Unless I'm misunderstanding the question, the shape's .extent property is all you need. with open('out.txt', 'wb') as out_text_file, arcpy.da.SearchCursor('path_to_data', ('msa', 'SHAPE@')) as cur: print >>out_text_file, "msa min_lon max_lon min_lat max_lat" for row in cur: msa, ext = row[0], row[1].extent print ...


3

The precision of the decimal field is 0. Due to limitations in the dbf format and shapefiles, you will have to create a new column. Make the decimal precision in that 5 or more.


2

You can use functions from the rgeos package to extract such regions (e.g. gIntersection, gDifference). I use gDifference in this example, because gIntersection returns a SpatialCollections object here: # define rectangular region y_lim <- c(-1, 1)*23.5 rect_lim <- cbind(c(rep(bbox(ao)["x", ], each=2), bbox(ao)["x", 1]), c(y_lim, ...


1

Assuming the data is really DD MM SS you can just add the data as follows LAT,LON 42 46 05 N,86 12 04 E I use spaces to separate DD MM SS and I assume since numbers are positive N,E. Other ways may work but I find this the fastest for me at least since using special characters takes typing time


0

WGS84 EPSG:4326 does not have metres as units, but degrees. KML files are always in degrees, so you have to set CRS to that, then reproject the layer to someting else with Save As .... Maybe you have used Set CRS for Layer, which is wrong in most cases. The extents you provide are a bit strange. For the kml, yMin and yMAx are very small, even if the point ...


3

Here is a user contributed PostGIS function called dms2dd. Your data however looks like Degree, decimal Minutes. You may need to modify the function to suite your needs. functions


0

The Latitude and Longitude for each Census Block in Louisiana is available in the shapefile information for blocks in these files. Download the counties representing your state, bring them together into one file, and then extract just the GEOID and the lat and long coordinates. Note: Actually, assuming you only need them in county 22001, just download the ...


1

If your comfortable on the command line cs2cs is a great way to convert coordinates. You can specify the coordinate system to convert to in from in multiple format, but epsg codes are convenient. To find the EPSG code for your coordinate system of interest look on spatialreference.org, for example see the page for UTM zone 35n. cs2cs +init=epsg:32631 +to ...



Top 50 recent answers are included