Tag Info

New answers tagged

2

If you want to query by x & y coordinates, use Get Cell Value (Data Management) . If you want to query by point features, you can use Sample (Spatial Analyst) or Extract Values to Points (Spatial Analyst). If you want an array of raster values in an extent, you can use RasterToNumPyArray (arcpy).


0

Your approach is very interesting. The Editor class in PyShp is still a work in progress but I'll look into it further. Here's some code I just tested using your bounding box on a US roads shapefile. PyShp does export the SHX and the DBF files. Those are the minimum requirements of a shapefile. The SHP file is the geometry, the SHX file is a simple ...


0

If you have ogr2ogr modules modules, you can actually run the line given by John Mangual in Python. This link have same helpful answers regarding to that. How do I use ogr2ogr to convert a GML to shapefile in Python Also you can run line with os module as in this link FWTools ogr2ogr in Python


0

Actually the answer is very easy 1) Calculate XMax XMin YMax YMin in Field Calculator with Python !shape.extent.XMax! Create 2 Fields where you calculate the difference between XMax and XMin, same for Y. Calculate Ratio All bigger than 1 is landscape, all smaller than 1 is portrait


4

Michael Miles-Stimson had the same idea as me, but since you aren't familiar with coding, here's another (similar) option. Turns out this is pretty easy to do using Field Calculator. Create a field called something like "Orientation" and make it a text type. Open the field calculator and set the parser to Python. Tick the "Show Codeblock" box and enter ...


1

Non-Python solution ogr2ogr -f "ESRI Shapefile" pr-roads.shp roadl_usa.shp -clipsrc -67.5 17.8 -65.1 18.6


2

Leaflet's map.fitBounds has an option padding which you can use like so: map.fitBounds(polygon.getBounds(), { padding:[50,50] } ); JSFiddle demo: http://jsfiddle.net/1vjqjx6h/


0

Have you tried creating a variable of the type 'Extent', and using that as a variable? Some additional string manipulation will likely be required to coerce your string into a format that ModelBuilder can recognize as an extent (ModelBuilder is misery for working with datatypes).


2

The units of the extent will inherit from the units of the projection of the data, so to convert the extent to lat/long, you would need to reproject your data to a geographic projection (usually WGS1984) that uses degrees as units. Your data appears to have been projected to NAD27 / UTM zone 11N, which has units of meters. The extent refers to the x and y ...


0

Thomas' answer works perfectly but I checked that it is not necesary to create a new function and define fromProjection and toProjection as global variables introducing directly the following code inside the script just at the end. map.events.register("moveend", map, function(){ $("#Bounds2").text(" -> "+map.getExtent()); ...


2

You could register the zoomend- and moveend-Event for your map like this: function bounds_update() { $("#Bounds1").text(" -> " + map.size); $("#Bounds2").text(" -> " + map.getExtent()); $("#Bounds3").text(" -> " + map.getExtent().transform(toProjection, fromProjection)); $("#Bounds4").text(" -> " ...


0

I am currently working with something similar, but I first set graphics for each feature in the featureSet and then add the graphics layer to the map (with map.graphics.add()), then iterate through the completed graphics array to get the union extent of its elements, using layer.graphics[i].geometry,getExtent(), then extent.union(ext), and finally ...


0

The Field Calculator uses the Calculate Field tool, and like many geoprocessing tools it honors at least some of geoprocessing environments. If the input is spatial (i.e., not a table), and the extent has been set, the calculation will be limited only to those features/records that are within the extent. If the extent doesn't cover any features, no ...



Top 50 recent answers are included