Tag Info

New answers tagged

1

You need to understand the definition of the spatial predicates. What you're really want is to know if a line traverses the polygon (and not simply cross it) Using the JTS Topology Suite, you can see that in both cases the predicates are the same: the two lines intersects and crosses the polygon: and With the JTS Topology Suite, you can use the ...


4

The problem is that your data is still retaining the decimal degree numbers, although not units. Subsequent geometry calculations still use the same raw numbers that were associated with decimal degrees, but erroneously assume different units (meters). For example, if I say I'm 65 feet tall, I haven't actually grown, I'm just using different units than ...


0

Using your code: private IPolygon BoundingPolygon() { try { IGeometryBridge2 pGeoBrg = new GeometryEnvironment() as IGeometryBridge2; IPointCollection4 pPointColl = new MultipointClass(); // edited here int numPoints = pList.Count; WKSPoint[] aWKSPointBuffer = new WKSPoint[numPoints]; for (int i = 0; i < ...


2

If you want every cell that contains a building to be switched on then don't use the polygons... Create centroids using Feature to Point for the polygons and use Point to Raster to generate the raster. This will guarantee that each cell that has a building centre on it will have a value. Optionally, if you want cells that contain part of a building but not ...


1

Looks like the cell assignment method is CELL_CENTER (so polygon would need to be located over the cell center to be digitized). Using MAXIMUM_AREA will capture more of the polygons, although possibly not all since the cell size is so much larger relative to the polygons. You might get closer to the results you want if you first make a Minimum Bounding ...


1

I believe you can accomplish this by right-clicking on the neighborhood layer, choosing 'Joins and Relates', choosing 'Join', and in the Join Data box that pops up, choose 'Join data from another layer based on spatial location', select your buildings layer and then select 'Sum' as the attribute you want added as a numeric attribute. See also: ...


0

I have done this using a model that, in your case, would iterate over each neighborhood and select then count all of the buildings whose centroid is within that neighborhood. This is pretty straightforward, I can post an image of the model that I use if you want. Also, you could adapt this from ESRI Support: Summary Instructions provided describe how to ...


2

You will want to use a spatial join. The easiest way to do this is (IMO) is by right-clicking the neighborhood (polygon) layer and selecting Joins and Relates -> Join and then at the top (where it says "what do you want to join to this layer") change from tabular join to a spatial join (based on spatial location). Select your point layer. Then you have ...


1

It sounds like the asker was able to answer their own question, but did so through an edit to the question. The solution was to use the Zonal Statistics as Table tool from the Zonal toolset of the Spatial Analyst toolbox. A link to the ArcGIS Resource Center article is here. The option for ALL was chosen for the Statistics Type.


4

You can also use the Multipart To Singlepart (Data Management) tool.


4

Under "Advanced Editing" there is a Button for "Explode Multi-Part features". Worked just fine!


2

Assuming you just want the general orientation of the polygon, rather than a specific segment... try the Minimum Bounding Geometry (Data Management) ArcGIS tool with the RECTANGLE_BY_WIDTH or RECTANGLE_BY_AREA geometry type and the MBG_FIELDS option. The MBG_FIELDS option will add the following fields to the output attribute table: MBG_Width—The ...


0

Given the nature of the lines you're trying to create versus the geometry you have, I think it will probably be fastest/simpler to just create new features as in the tutorial you have linked to. Any method that actually converts the polygons to lines will involve splitting the lines at certain points and/or deleting a lot of extra nodes/lines/etc. There is ...


0

Use the polygon to lines tool and then remove those parts of the line layer which you don't want to keep.


1

I do it this way by creating an Array of Point objects that form a line that closes back on itself, and then creating a Polygon object from that Array: # feature_info eventually takes the following form: [[734855.5142000001, 4744379.424500001], [740607.6685000001, 4744379.424500001], [740607.6685000001, 4736862.1753], [734855.5142000001, 4736862.1753]] ...


0

The hint provided by @mdsummer of using byid=T worked for me. Here is one example reproducible example: library(maptools) library(rgeos) brazil_states <- readShapePoly(fn="C:\\...\\BRA_adm1") #Brazil's state boundaries; download here: http://www.diva-gis.org/datadown plot(brazil_states) bioms <- readShapePoly(fn="C:\\...\\Biomas5000.shp") ...


0

Create proximity polygons to segments, using Spatial analyst, raster to polygon. Inresect them with road polygons. Felix


0

If the segment_ID is in the attribute table Split Layer will split the original file based on the field you input.


4

Buffer the lines. Use Difference to subtract the buffer polygon from the original polygon (p0).


1

I'd suggest to poligonize the grid and to then intersect the polygon grid with the other input polygon layer. That should be much less trouble.


0

There's no quick and easy way but for the benefit of someone else with the same problem the solution is to convert the geography type to a geometry type, take the bounding box (envelope) of the geometry and pull out the 1st (min) and 3rd (max) points. CGMinLong AS (CONVERT(float, geography::STGeomFromWKB( ...


4

Network Analyst is an ArcGIS extension which can be accessed either through a Desktop application such ArcMap (for manual GIS routing analysis) or as a web service when exposed as an ArcGIS Server service. There are multiple approaches to expose the drive-time analysis service (by the way, the drive-time analysis is also called a "service area" in Esri ...


0

Your purpose seems to be the construction of a quadtree spatial index. You can build it recursively starting from the top and building lower levels until your criteria (number of features per cell) is met.


0

As well as mmqgis (mmqgis->Import/Export->Geometry Import from CSV) that Andre mentions, if you have the points data in QGIS already (possibly via the delimited text import), then you can use Points2One plugin to assemble them into polygons. You can also do it in SAGA but would need a two step process (points->lines->polygons). As ever, you can also ...


1

The mmqgis plugin is a bit more comfortable than the delimited text import. You can read from csv, and choose whether the result should be points, lines or polygons. EDIT The source data you now added to your question looks pretty much like Openstreetmap format. So you can add it using Add Vector Layer or the Openstreetmap plugin, part 2 and 3. Part 1 ...


0

You require to check out the licenses of the extensions required: aoInitialize.CheckOutExtension(esriLicenseExtensionCode.esriLicenseExtensionCode3DAnalyst); aoInitialize.CheckOutExtension(esriLicenseExtensionCode.esriLicenseExtensionCodeSpatialAnalyst); When using an ArcView or ArcEditor license, a program must explicitly use AoIntialize, and ...


1

try this using ESRI.ArcGIS.DataManagementTools; FeatureToPolygon featureToPolygon = new FeatureToPolygon(); featureToPolygon.in_features = pInWorkspace.PathName + "\\" + pInFeatureClassName.FeatureDatasetName.Name + "\\Temp_Line_UnNamed"; featureToPolygon.out_feature_class = pInWorkspace.PathName + "\\" + pInFeatureClassName.FeatureDatasetName.Name + ...


2

There are two things in that zip file: the "raw" raster data koppen_ics a layer file The layer file is just a pointer to the original data, with additional information about symbology (in this case, providing short text names for the various climate zones). Layer files are useful for saving a set of layers and symbology, but they can't be used if the ...


2

From a cartographic point of view, it is commonly assumed that the human perception of a line position is around 0.3 mm. For a given map scale of 1:20,000 or smaller, the USGS’ NMAS has established that 90% of all the points tested must fall within 1/50 of an inch (0.5 mm) (as measured on the map) to their known positions on the planet (see here). This can ...


4

For general centroid creation, QGIS QgsGeometry functions wrap respective calls to the underlying GEOS library: QgsGeometry * QgsGeometry::centroid() (definition) calls GEOSGetCentroid (definition) QgsGeometry * QgsGeometry::pointOnSurface() (definition) calls GEOSPointOnSurface (definition) The pointOnSurface() function is new for QGIS 2.4 and allows a ...


0

Centroid computation in Qgis are based on the GEOS library. I can then refer you to the the documentation of GEOS itself (http://geos.osgeo.org/doxygen/classgeos_1_1algorithm_1_1Centroid.html) where you can find the basic principle for polygon centroid computation: Based on the usual algorithm for calculating the centroid as a weighted sum of the ...


1

As it turns out, the solution is to group on the region id. I think I knew this once, but hopefully this can save someone else some Google time. ggmap(OhioMap) + geom_polygon(aes(x=long, y=lat, group=group), fill = 'grey', alpha=0.4, color = 'black', data = Counties.fort)


0

I would check the actual geometry for errors as well. Self intersects can cause differences in reported areas. Run the "repair geometry tool" to find and fix them?


1

My money is on overlapping polygons. You don't say what software you have access to, but in ArcEditor or ArcInfo (I may never get used to saying ArcGIS for Desktop Advanced, yuck) you could create topology with a "must not overlap" rule and find out that way. (That would also be how to fix it.) Or perhaps easier, fill them with different colors and make ...


0

Try checking if they are all on the same projection! if they are on different projections their areas may come up as different. You can do this by right clicking your shapefile and going to preferences, then open the tab 'source' and scroll down to Projected Coordinate System.


0

Assuming that you have converted the green polygon to a raster and then to points, the more complex question is how to determine which point is closest to both polygons. You need to minimize both the distance to each polygons, and difference in distances. Run Generate Near Table twice, each time using the points as Input Feature: once the north settlement ...


0

the shortest possible distance between two areas is somehow undetermined. I guess that you mean something near the middle of your two settlements so that one does not have more to walk than the other. Here are a few things that you could do : 1) a)get the centroid of your polygons (feature to point) b) create a line based on those centroid (XY to line) ...


0

Gdal_rasterize uses the center of the pixel. As a workaround I would either rasterize a buffer around your input polygon (with half pixel size) or apply mathematical morphology on the result (aka erosion of one pixel)


2

There is a QGIS plugin called Digitizing Tools: The documentation says: Split selected features with selected line(s) from another layer applies to: line and polygon layer (multi or single part) Splits all selected features of the active layer with the selected line features of another layer. The splitting creates new features (not multi features). Each ...


0

Solution that works for me best involves picking subset of GPS tracks to construct an outline. For that I've wrote an algorithm that takes dissolved (split at intersection points) tracks set. The algorithm is very simple. It is based on searching for the neighboring track with the smallest angle between intermediate path end vector and candidate curve. This ...


1

An "amusing" way to solve the issue of there being only one feature in your input feature class would be to make a feature layer to select every feature (in this case, 1) and then run select layer by location with the parameter selection_type="REMOVE_FROM_SELECTION". Then, GetCount() will return a 0 if the feature is indeed within the polygon (selected and ...


3

The Select Layer By Location (Data Management) tool has various overlap_type values that you can use so I think you should try: COMPLETELY_CONTAINS —The features in the input layer will be selected if they completely contain a selecting feature. The input features must be polygons.


4

To do this I would use the Intersect (Analysis) tool. The ArcPy code will be: import arcpy homesFC = <your path to input Homes> districtsFC = <your path to input Districts> homesWithDistrictFC = <your path to output> arcpy.Intersect_analysis ([homesFC, districtsFC], homesWithDistrictFC)


4

I've figured out an algorithm for the grid approach using several Python tools. Rasterising and polygonising is done with rasterio, which is based on GDAL/OGR. Here are most of the imports: import rasterio import numpy as np from rasterio import features from shapely.geometry import mapping, shape from shapely.ops import cascaded_union from math import ...


1

If you are working with anything but points, you need to convert your shapes to WKT (well known text) columns, and then save that as csv. There is an expression in qgis 2.2 field calculator, it is in a geometry branch, named - geomtoWKT. Haven't tried it. If that doesn't work for you, try searching for other ways to get WKT columns. Just saving layer as csv ...


2

On the assumption that you have an Advanced level license (you do not specify otherwise), I think you should try the Near (Analysis) tool: Determines the distance from each feature in the input features to the nearest feature in the near features, within the search radius. ... Both input features and near features can be point, multipoint, ...


1

Sketch properties represent geometry coordinates of a feature. In ArcGIS environment, you can access (print, store to txt files,..) geometry properties by: import arcpy infc = arcpy.GetParameterAsText(0) # Enter for loop for each feature # for row in arcpy.da.SearchCursor(infc, ["OID@", "SHAPE@"]): # Print the current multipoint's ID # ...


3

The Euclidean Allocation tool can accept your polygon as input, but you are right you need to set the values inside the polygon to NoData for this tool to work, otherwise it will pick up the values that are already there. First to feature to polygon, this will give values (any value, it doesn't matter, we're only interested in value or NoData) inside the ...


2

Do the following: add field "OldArea" to the parcels and populate with area values (Field right click - Calcualte Geometry) Perform Intersect with the Zones dataset add another field ("NewArea") and populate with areas after intersection (same way than #1) calculate the percentage = (NewArea/OldArea) * 100 in the new field


0

If you just want to limit the layers from showing beyond a certain point, you could apply scale dependency to the layer by using code similar to below that gets run each time the user zooms in or out: //Show or Hide layer based on a certain zoom level function onZoomend(){ if (map.getZoom() >= 11) { map.addLayer(mylayer); } else { ...



Top 50 recent answers are included