Tag Info

Hot answers tagged

5

Yesterday I had no time to create it in details... See my solution in 4 steps: CREATE OR REPLACE VIEW bd_segment AS SELECT ST_PointN(geom, generate_series(1, ST_NPoints(geom)-1)) AS sp, ST_PointN(geom, generate_series(2, ST_NPoints(geom) )) AS ep FROM -- extract the individual linestrings (SELECT ...


2

Because you are using the geography type instead of the geometry type, the corners of your rectangle are connected by great circles, not lines along the parallels as you might be expecting. Your query works just fine if you cast your rectangle and point to ::geometry. SELECT ST_Covers(geog_poly::geometry, geog_pt::geometry) As ...


2

Go with steps: -Create spatial indexes for your tables. -Create Buffers CREATE OR REPLACE VIEW b1 as SELECT ST_Buffer(the_geom,500) as the_geom, attributes, fid FROM stores; CREATE OR REPLACE VIEW b2 as SELECT ST_Buffer(the_geom,2000) as the_geom, attributes, fid FROM stores; (I am not sure, but maybe you should reduce here you 8 million point to ...


1

Here is a code sample to show how you could publish a WMS layer hosted on geoserver in Leaflet: var map = L.map('map').setView([51.505, -0.09], 8); var forest2000 = L.tileLayer.wms("http://138.26.24.xxx:8080/geoserver/tiger/wms",{ layers: 'forest2000', format: 'image/png', transparent: true, opacity: 0.7 }).addTo(map); Change ...


1

CREATE VIEW results AS SELECT somefield, (ST_Dump(ST_Union(geom)).geom geom FROM somelayer GROUP BY somefield;


1

see my solution: first you need to create line from your points: ST_MakeLine(geometry geom1, geometry geom2); http://postgis.refractions.net/docs/ST_MakeLine.html And than you need to create a buffer around the line, but because you are in degree coordinate system (probably wgs84) you should transform the line into another coordinate system (meter based). ...


1

Your query looks rather strange. What are you trying to achieve with two buffers around the same point? You can replace ST_Distance with operator, but still we have to overthink the buffer thing. Could you specify your goal a little? PS: Did you build spatial index? UPDATE: I would try SELECT * FROM ( SELECT a.gid, b.gid, ...


1

The query you're using is correct, but a detail for you to take into account. ST_Area result will be expressed in SRID units if you use directly the_geom. If you want to get the area in square meters, you need to cast your geometry to geography, by using: UPDATE cartodb_query SET area = ST_Area(the_geom::geography)


1

Use the &&& operator for a hypercube query. Since like its brother && it is a bounding box query, you just need to create a query geometry that spans the desired cube: a linestring is the easiest to make: SELECT * FROM myTable WHERE point &&& 'LINESTRING(50 50 50 50, 100 100 100 100)';



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