-
Notifications
You must be signed in to change notification settings - Fork 57
Display several spatial columns #42
Comments
Ok reading the bottom note in the readme and pr #17 I see that this is logically not possible (yet)? |
I would say since the query ends up being converted into geoJSON/topJSON, it's not a good practice to have two geometries in the result set. Postgis preview is looking for one specifically called I would suggest you restructure your query so that your geoms are in the same column on different rows by UNIONing together two subqueries. However, you are also mixing points and polygons in the same response, which may also cause problems. |
Well, imho the tool should take any query no matter what the parameters are and visualize the result as good as possbile. One approach would be to use the GDAL/OGR libs to:
This approach would also eliminate the need to explicitely name the geometry column. I am doing exactly the same using the python OGR libs and it works flawlessly. Can't help much with node though unfortunately |
I think it is reasonable to require that there is only one geometry per It is a simpler proposition to combine your geometries together as part of On Monday, August 8, 2016, rajanski [email protected] wrote:
|
I still think it's easy to do. I don't mean to be a smartass, I just think postgis-preview is really great and can be an awesome tool for geospatial devs as well as for teaching people spatial sql. So the simpler and more straight forward it is, the better. Just save the following code as a html file and run it in a browser (geojson with geometrycollection with multiple geometries in leaflet, working flawlessly)
|
Just putting my two cents in. IMHO, it's usually easy enough to just e.g. @rajanski your query can be written to include both of your features as follows: SELECT ST_GeomFromText('POLYGON((-71.1776585052917 42.3902909739571,-71.1776820268866 42.3903701743239,-71.1776063012595 42.3903825660754,-71.1775826583081 42.3903033653531,-71.1776585052917 42.3902909739571))', 4326) as geom
UNION
SELECT ST_GeomFromText('POINT(-71.064544 42.28787)', 4326) as geom Honestly, I'd rather the preview work as is and not try to make too many assumptions with your data. I don't think telling people to |
@seabre I get your point . Anyway I was looking at postgis-preview from a point of teaching SQL and postgis. In this context I do still think it would be better to make it behave like any other postgresql query client. |
I think the original intent was to behave like CartoDB, where only one geometry column is expected. IMHO it becomes more confusing to allow multiple geometry columns, as it may not be clear which one is being rendered. |
They are all rendered as geomcollection |
I think we should stick to a single geometry column with a specific name for the moment, if you still feel strongly about this, feel free to re-open. |
Hi postgis-preview is really great! Thanks!
Only I couldnt manage to display two different geometry columns from one query as in
The text was updated successfully, but these errors were encountered: