Tag Info

New answers tagged

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 ...


0

You can use turf.js in client side (as Devdatta said) but also on the server. It requires nodejs and spatial data in geojson format, the perfect format if you like to render it on a leaflet map. You can install just the modules that you need: Buffer: turf-buffer Merge: turf-merge Overlap: turf-overlaps Here is an example with node


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 ...


0

It seems that there was a problem with the data. I've loaded another dataset, and the spatial functions runs ok both in geography and geometry types.


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 ...


0

I'll just use intersect. Should have known that the tool can intersect on a single layer.


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 ...


0

As @Mapperz says, you can generalise the lines down before exporting and entering in to Illustrator. You can generalise lines with Vector > Geometry Tools > Simplify Geometries


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 ...


0

Take a look at the Global Administrative Areas dataset at http://www.gadm.org, it contains at least the boundaries, though I am not so sure about the territorial waters part


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 ...


0

SA free approach is 1) convert raster to points, 2) spatial join points to polygons 3) select values greater 50 4) apply summary statistics using polygon id as case field. Could be very slow, depending on raster size


-1

I WAS LOOKING TO CREATE LEGIT DONUTS, PERFECTLY ROUND BUFFERS. IF YOU USE THE MULTIRING BUFFER TOOL AND SELECT DISSOLVE ALL. YOU CAN THEN DELETE THE SMALLER OF THE 2 BUFFERS LEAVING A PERFECT DONUT.


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 ...


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.


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 ...


0

Few things: Starting with the precision of measuring an computing areas and distances based on OSM basemaps. OSM tiles are using a geographic coordinate system which is pseudo-wgs84. That is mainly aimed to speed-up display on computer resolution, while distorting the shape and size of map element, i.e features. Hence using those tiles-base maps to ...


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 = ...


0

So I went for the library(sp). I now made a data frame with 0 or 1 if the line was contained in the polygon. I later use this data frame to subset the correct lines for each polygon for area calculation and comparison. for (r in 1:length(LALarea.x) ) { for (q in 1:length(LDdia.x) ) { ...


0

I have the same problem, some areas are calculated just way too big and I can't explain it. Changing it from Multiparts to single parts does not change anything, the areas stay exactly the same. Sometimes, also redrawing does not change anything. Does anyone have more ideas about what could be wrong?


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])], ...


0

Cross Tabulate Statistics might work for you if you are using ArcMap 10+ and want Chi-square and/or Kappa statsCrossTabulateStatistics


0

A Pearson, Kendall or Spearman correlation (R) between two nominal variables is nonsensical. You want to explore techniques such as contingency analysis (Phi coefficient, Cramér's V, Persons C, Kappa, ...), factor analysis, canonical correspondence analysis or perhaps something in the family of Jaccard's similarity statistics. If you put one variable (y) in ...


0

Here is an approach I would try: First explode the multipolygon into a a set of single features. (In QGIS that's under the Vector->Geometry Tools->Single part to Multipart) Then import the polygons into a spatial database such as Spatialite, and run a query that searches for polygons that do not touch any other. In general you would write a query that ...


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 ...


0

I don't know how you would automatically create an ellipse that contains 75% of your point layer. I would approach this task in this way: Create a grid layer or a custom polygon layer to overlay your point layer perform spatial analysis in qgis by using Vector -> Analysis Tools -> Points in polygon The procedure is similar to what is described as ...


0

I don't have a code sample. and this is purely commercial solution. But it is world class. 1Validate by 1Spatial. They have the capability of integrating Topology QA/QC into many GIS enterprise systems. I got pretty far along looking at an oracle spatial/autocad map solution on •1Spatial Management Suite. But that suite is just a suite of tools you ...


0

I can only suggest a simple method that will give an approximate on average; yet if you are looking for the exact percentage reduction of area this would not work - but might guide your thoughts towards a coding solution. This method is based, like others have suggested, on negative input to the buffer tool. However it also involves adjustment to the the ...


2

Since OGR version 1.10.0 the sqlite SQL dialect has been able to be applied to any spatial datset. Which is great, as it means that you can apply it to your GeoJSON files. Looking at the OGR GeoJSON documentation you can see that the layer name for a GeoJSON file is OGRGeoJSON which means that the SQL that selects from the GeoJSON file will translate from ...


0

INSERT INTO tablename (name, polygon) VALUES ( 'Name', ST_GeomFromGeoJSON ( '{ "type":"Polygon", "coordinates":[ [7.734375,51.835777520452], [3.8671875,48.341646172375], [7.20703125,43.580390855608], [18.6328125,43.834526782237], ...


2

Use a Categorized style on the layer.


2

In QGIS 2.8.1 version, Right click on the layer. Go to Layer Properties. Clcik Styles Tab. Select drop down value Categorized. Use Random colors from Color Ramp drop down list.


4

This method uses the intersect() function from the raster package. The example data I've used aren't ideal (for one thing they're in unprojected coordinates), but I think it gets the idea across. library(sp) library(raster) library(rgdal) library(rgeos) library(maptools) # Example data from raster package p1 <- shapefile(system.file("external/lux.shp", ...


1

If you have the spatial analyst extension you can use the Euclidean Distance tool. 1. Convert the buffer to a raster with the "To Raster" tool (under conversion tools). 2. Then run the Euclidean Distance Tool which will create a raster with values representing distance from the cells that comprised the input raster. 3. Then if necessary, you can extract ...


1

In ArcGIS, you can use tabulate area for this. It will give you a table as output with the number of pixels of each class within each polygon. Then you need to divide each column by a the total count and you have the percent. Note that ArcGIS selects a default raster size for internal analysis. So it is better to specify the pixel size in the environment of ...



Top 50 recent answers are included