Tag Info

Hot answers tagged

3

You can do this in R using gTouches in the rgeos package. Use rgdal package to open your geojson: library(rgeos) library(rgdal) polys <- readOGR("polys.json", "OGRGeoJSON") gTouches(polys, byid=TRUE) With success, will produce an adjacency matrix in the form of: ## 0 1 2 3 ## 0 FALSE TRUE TRUE FALSE ## 1 FALSE FALSE FALSE ...


2

You can do this in two steps. First, use Con (Spatial Analyst) to convert cells > 50 to 1 and all other cells to 0. Then use Zonal Statistics as Table (Spatial Analyst) to count the number of "1" cells within your polygon.


2

If you look at what is coming back from the server, by looking at the Network tab of Developer Tools, eg, in Chrome or Firefox, CTRLSHIFTI, then choose Network Tab, you will see a URL such as the following, http://www.ma-investment.gov.bh/bps_ppd_en/ESRI.ArcGIS.ADF.Web.MimeImage.ashx?ImgID=39a0cec7-30f8-4291-8dce-1b2509b2fe62&CacheTime=1&kc=1 ...


1

OK so I wanted to convert islands to holes and holes into islands but couldn't find a command to do it in QGIS so I wrote a script myself. Here is that "simple" script which will invert an input_layer into a bbox polygon in an output_layer. The whole process ran over a couple of seconds to invert a 25MB shape file. Better than crashing out with a call to ...


1

The answer to your question is yes. You might like to clarify what kind of server-side software you have. You can use GeoServer to do WPS requests. You could use a Python library like Shapely. Or a C# library, or a Java library, or a JavaScript library. Or the QGIS API, or the ArcGIS API or the database, be that SQL Server, PostGIS or Oracle. So, to ...


1

I see two fixes: For the first error: ERROR 000161: The length of the grid name must not exceed 13 characters Convert your output to tiff format, which does not have the character length limitations that the Esri grid raster format does. mamcnty_out = os.path.join(output_workSpace, "cnty_" + species_str + ".tif") For the second error: ERROR ...


1

You can easily recreate the functionality with ol.interaction.DragBox. The interaction has a boxend event, which propagates an object with a getGeometry() function. The geometry can be added to a new feature, which can be added to the vector source. The geometry can be logged directly from the boxend event handler, but the source object also has an ...


1

The Spatial Join geoprocessing tool will do what you're looking for. With the tool parameters something like this Target Features: polygon dataset to which you wish to join attributes. Join Features: polygon dataset from which the attributes will be transferred IF they meet the Match Option (Spatial Relationship). Output Feature Class: feature class to ...


1

The only way that I know of to do this, requires spatial Analyst so perhaps I'll write it up as such and if it is possible another way, someone else will write that up as a separate answer. With the Spatial Analyst Extension, the tool to use is Zonal Statistics. I typically use Zonal Statistics As Table. I typically use a projected coordinate system ...


1

Of course you can. You must translate your string to an array of coordinates readable by your map. Something like that: var polyCoords = []; var coords = "95.61,38.60 95.22,37.98 95.60,37.66 94.97,37.65".split(' '); for (var i in coords) { var c = coords[i].split(','); polyCoords.push(ol.proj.transform([parseFloat(c[0]), parseFloat(c[1])], ...


1

Buffering by zero is a common 'hack' which works well in most cases, and it is not clear from your question why this is unacceptable for you. Spatially enabled databases like PostGIS (which is free) usually have an ST_MakeValid function, which should answer your needs. You can use this in conjunction with other tools such as ST_IsValidReason or ...


1

I was facing a similar problem, and ended up solving the equation for both circumference and area of a circle to make them equal one another like so: 2*pi*r = c <=> r = c/2*pi pi*r^2 = a <=> r = sqrt(a/pi) c/2*pi = sqrt(a/pi) <=> sqrt(a/pi) -------------- = 1 c/2*pi This index is between 0 and 1 where 1 is a perfect circle. I ...


1

I wrote this script to perform the same functionality as the split tool. If you're splitting a large feature class you may want to change the copy features for something else. The feature class I split was small. import arcpy, os arcpy.env.workspace = "" list = [] #Input the values you would normally split by or populate this using another method input = ...



Only top voted, non community-wiki answers of a minimum length are eligible