Tag Info

Hot answers tagged

7

You can do it via the geography type, using a geography index, or via the geometry type with some math to adjust for distortions in mercator. With geography: CREATE INDEX gb1900_geog_idx ON gb1900 USING GIST (geography(the_geom)); CREATE TABLE newtable AS WITH c AS ( SELECT a.cartodb_id, count(*) FROM gb1900 a, gb1900 b WHERE ...


3

The length of degree in north-south is about the same so you could use 1/110574 degree/meter as a factor. However, the farther to south or north you go the bigger the error is in east-west direction. For example, take these two shapes which have a 1 degree buffer in EPSG:4326 transformed into EPSG:32630 (UTM zone 30N). First one is from 40°N and the second ...


3

you can't really convert convert distances in degrees into meters as the size of a degree varies as you approach the poles. convert your locations into a projected coordinate system, then calculate your distances.


2

As an approximation suitable for medium-small radii, use the cos() of the latitude to scale up the true distance to a "distance" that makes sense for your latitude in web mercator, as described here. SELECT * FROM mytable WHERE ST_DWithin( ST_Transform(ST_SetSRID(ST_MakePoint(%lon, %lat), 4326), 3857), the_geom_webmercator, %radius / cos(%lat * ...


2

How about partitioning your space into 9 regions and imposing the equal distance criteria separately in each. For example, For line segment #1, partition the space into 3 regions Points whose projection along the line segment normal actually fall on the line segment. Call it C1. Points whose projection along the line segment normal fall to the left of the ...


2

If the line you are talking about is indeed a route, then you can use the tool "Locate features along route" - This will give you the measures of the points. The next step I would export the table to excel and then you can use a formula to calculate the distance between each point. For example =B2-B1, then drag to the bottom.


1

Convert points to individual lines using Points to Line (Data Management). Place points along the line at regular interval. To do so you might use linear referencing, alternatively search this site, something will pop-up. Calculate distance for each point along the line (Chainage in below table) . Search this site, let me know if fail, I’ll post script or ...


1

Merge your old and new feature classes into one, then, using the Points to Line tool, input your merged table, and use the common field as the "line field"


1

You can take an average of each pair of end points and draw a line between them. Say the left two points have ID 1 and 2, WITH t AS ( SELECT avg(ST_X(geom)) as x, avg(ST_Y(geom)) as y FROM test WHERE gid in (1, 2) ) INSERT INTO test (geom) SELECT ST_SetSRID(ST_MakePoint(t.x, t.y), 4326) FROM t; That creates a new point midway between ...


1

Maybe you should re-save again your data (right click on the layer,save as).. this time make sure you change the crs which has distance unit (e.g wgs 84 world mercator - meter units). This new layer should have new distance unit. You can check again whether you already use the right crs through metadata (you can also use qgis browser)


1

Thank you whuber, that helped. I made an ascii file to define the weights and then ran an weighted focal mean. Because it didn't work out in ArcGIS (there seemed to be something wrong with my txt file) I ran the whole process in QGIS (where the same txt file worked fine). I thus used the r.neighbours command, which is the QGIS equivalent of the focal mean ...


1

Thanks again @FelixIP, and I'd like to post my new answer Here, the independent variables include slope, elevation, precipitation,distance to roads, and distance to river, and all values are 0 to 100 after doing normalization. For normalization all the values to a range of 0 to 100, I used the Raster calculator tool in ArcMap 10.1 with this equation: ...


1

On second thought I decided to post my answer. Normalising variables, which solved an issue is not exactly GIS thing, however careful spatial variables selection for regression analysis is. I'd suggest caution with that many independent variables, because some of them aren't really independent, e.g. distance from 'river' and terrain slope. I've made a ...


1

Here is another option: Use the Split Line at Point tool Splits line features based on intersection or proximity to point features. Open up the attribute table of the output layer of split line and create a new numeric field called "length" Right click on "length" field and and select Calculate Geometry, feature length



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