Tag Info

New answers tagged

0

Your query that is producing rec is this one with only field id: EXECUTE 'SELECT id::integer FROM layer_vertices_pgr ORDER BY the_geom <-> ST_GeometryFromText(''POINT(' || x || ' ' || y || ')'',4326) LIMIT 1' INTO rec; You create the query with field source in text variable sql, but never actually execute ...


2

Try this SELECT SUM(length) As length FROM (SELECT DISTINCT ON (r.gid) r.gid, ST_Length(r.geom) As length FROM roads AS r JOIN cadastre AS c ON ST_Intersects(r.geom,c.geom) WHERE ST_Length(r.geom)>500 AND ST_Area(c.geom)>2000 ORDER BY r.gid ) As rc; ...


2

The where condition you are looking for is: points.Obj Within polygon.Obj AND polygon.income > 1500 You can also solve the problem by using a sub select query instead of a join query. Here is how to fill in the details in the SQL Select dialog: Select: * From: POINTS Where: OBJ Within Any (Select OBJ From POLYGON Where INCOME > 1500) Or in a ...


1

You can use ArcMap's [Make Query Table] geoprocessing tool to: Set input table to your points data. Select need fields(you must select Shape field if you want get result with feature) In the where_clause,input as your question([Time] in (SELECT MAX( [Time] ) FROM data_table GROUP BY [Name])) Set table name if you not need default out table name. Click Ok ...


1

So the quickest answer is that SQL expects the same dimension of columns in each statement you try to do a UNION on. So all the first column of your SQL statements should match what you want to be in the first column of your result. Generally, they will also need to match in data type. The column names themselves don't matter. So to make yours work you'd ...


2

The use of && will return quicker than ST_Intersects, as it is only checking bounding boxes, which is the first stage of any spatial intersection query, via the bounding boxes stored as part of R-Tree indexing (technically a GIST index in Postgis, but the bounding box is still used in index construction). As, the second stage, the actual intersection ...


0

I think you have a pretty similar example to what you want to build here: http://bl.ocks.org/xavijam/378c6dc0d43654280757 As @javisantana says, it's applying a JOIN in the query in order to get the layer and information from both tables, which will be displayed in the infowindow. If you share with us the code you have at the moment we could give you more ...


1

Just use Geoserver SQL views http://geoserver.geo-solutions.it/edu/en/adding_data/add_sqllayers.html http://workshop.pgrouting.org/chapters/geoserver.html


0

You could pass the entire layer by parameter to createSelector function. I mean: createSelector(layers[1]) And then, in the function, you could select the sublayer that you really want depending on the clicked that you receive.


0

Just use AND in your WHERE clause...


2

Please add WHERE ST_Intersects(lg.geometry, bbox.geom) AND admin_level < 4. This will give you the result for those features which intersect with the given geometry AND whose admin_level is less than 4.


0

After reviewing your code and playing with some examples myself I think that the problem is that the WHERE clause of your query is a bit too restrictive, cause WHERE address='" + data.address + " will discard any rows not matching that criterion. I'd need to check your table to be sure about that, though. What I think you need would look like this: ...


0

You can use a SQL join in your visualization, like: select a.the_geom_webmercator, a.column_1, b.column_2, b.column_3 from school_count a, heisman_winners b where a.school = b.school; (in this case you need to do the appropriate join) You can set the query in the visulalization using CartoDB UI or using setSQL in the sublayer (using javascript)



Top 50 recent answers are included