Geometry column - invalid representation
See original GitHub issueBug report
Describe the bug
When creating a geometry data type column, its representation is looking odd. It shows a random capital letter string such as: 0101000020E61000002C64AE0CAA0129409F1CAACE0FF34440
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Create a table
- Add a geometry data type column with:
SELECT AddGeometryColumn ('','geometries','geom',4326,'POINT',2);
- Insert records to the table with the geometry column as
ST_SetSRID(ST_MakePoint(lng, lat), 4326)
- See the table editor in order to find the column representation.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
It shows like this:
But should show something like:
System information
- OS: Windows 10
- Browser: Chrome
Additional context
Followed this tutorial to get the column as I wanted.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
ERROR: parse error - invalid geometry (Postgis)
Use the Postgres concat operator to add a leading LINESTRING, so that you have a valid textual representation of a geometry.
Read more >MySQL Bugs: #80123: Invalid MULTIPOLYGON geometry ...
Description: Trying to add a 'MULTIPOLYGON(((0 0,0 0,0 0,0 0)))' to a geometry column succeeds althought GIS data seems to be invalid since ......
Read more >Error when trying to alter column type from text to geometry
The error means that the geometry input function expects the string to be in EWKB format, where each byte is represented by two...
Read more >Data QA: Identifying Invalid Geometry Types - FME Community
Whether such a geometry is truly invalid depends on both the user's interpretation of the data and any special circumstances. For example, the ......
Read more >Chapter 4. Data Management - PostGIS
In planar reference systems the X and Y coordinates typically represent easting ... PostGIS also allows storing and manipulating invalid geometry values.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can use
SELECT st_asgeojson(location) FROM tbl
to get the representation you want.https://postgis.net/docs/ST_AsGeoJSON.html
Not really invalid, it’s the
geometry
type default representation, which has to be converted to other formats to be human-readable.http://postgis.net/workshops/postgis-intro/geometries.html#geometry-input-and-output
I think it’s as Steve mentioned above, it’s the default presentation for
geometry
(can be confirmed withselect st_point(1,1)::geometry
in psql).Making it more user-friendly from the dashboard side might be a lot of work (e.g. need to parse the format) but as a user I would just add a generated column like so: