Questions tagged [well-known-binary]
a format for representing geographical and geometrical data in binary format.
95
questions
4
votes
1
answer
153
views
How SRID is represented as part of EWKB [closed]
I am trying to find the spec that defines how the SRID metadata is included as part of EWKB in PostGIS.
Which bytes/hex values represent the SRID metadata in EWKB? Where can I find a spec on EWKB ...
1
vote
1
answer
572
views
Convert SQLite3 Geometry BLOB to WKB for PostgreSQL
I have used iterdump() to create an output file from a SQLite database that includes SpatiaLite data. I need to convert the hex data to a geometry in PostgreSQL.
I have found here a summary of how the ...
3
votes
1
answer
107
views
Creating QgsGeometry from Extended-WKT or Extended-WKB
Creating a QgsGeometry using a WKT/WKB string is a fairly standard procedure using pyqgis:
wkt = 'MULTIPOLYGON (((0 0, 1 1, 1 0, 0 0)))'
wkb = '...
2
votes
2
answers
685
views
Passing a WKB generated by Geopandas into an Oracle SDO_GEOMETRY constructor
I'm trying to iteratively pass WKBs created by Geopandas into an Oracle SQL query but I'm getting this error:
DatabaseError: ORA-29902: error in executing ODCIIndexStart() routine
ORA-29532: Java call ...
1
vote
1
answer
277
views
WKB to feature class in ArcGIS Pro
I have a table in azure databricks called prod.locations that I am connecting to in ArcGIS Pro through an OLE DB Connection\Microsoft OLE DB Provider for ODBC Drivers. This table has a column called ...
2
votes
0
answers
214
views
Languages to represent ellipse geometry (WKB/WKT)
I am new to the idea of representing vector geometries in a text markup language. I am looking into different representations for geometries consisting of smooth curves and three dimensional objects, ...
5
votes
1
answer
1k
views
Convert bytea to geometry column with PostGIS
I am trying to create a geometry column from bytea.
I imported OSM data using ogr2ogr using the command
ogr2ogr -f PostgreSQL -nln bahamas_multipolygon PG:"dbname=openstreetmap user=postgres ...
0
votes
0
answers
160
views
Importing WKB data into ArcGIS Pro
I have received a CSV data file with the geographical data column in WKB format.
How can I import this into ArcGIS Pro or is is some conversion tool required before I can import this into ArcGIS?
0
votes
1
answer
3k
views
psycopg2 cursor.copy_expert() BadCopyFileFormat: extra data after last expected column when writing WKB data
I am trying to write a WKB representation (i.e. a binary string) of a Shapely Polygon into a PostgreSQL/PostGIS database using psycopg2 cursor.copy_expert() for a bulk insert.
I narrowed down the ...
4
votes
1
answer
2k
views
GeoJSON AttributeError('str' object has no attribute '_geom') - when converting to WKB format
I am parsing through a GeoJSON and picking out elements using Python.
{
"type": "FeatureCollection",
"features": [{
"type": "Feature",
...
4
votes
1
answer
3k
views
Convert GeoJSON geometry to new coordinate system and WKB format in python
I have a GeoJSON like such:
{
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": {
...
1
vote
1
answer
405
views
Creating Python OSGEO/OGR geometry with M-values (not using WKT)
I am trying (and failing) to generate M-value geometries (e.g. POINT M, POINT ZM, LINESTRING M, ...) with Python's osgeo/ogr library.
Here is what I've tried to far:
import ogr
# Use OGR specific ...
0
votes
0
answers
263
views
Converting base64 encoded geometry to WKT
An element in a received XML-file contains the geometry, which I believe is base64-encoded:
<pointData>...
4
votes
1
answer
1k
views
How to import PostGIS into BigQuery GIS?
I have to import PostGIS data into BigQuery GIS.
In order to do this, I dumped the PostGIS data in CSV and import it into BigQuery.
This is working for all the columns but not the geometric one.
If I ...
3
votes
0
answers
277
views
Use ST_AsBinary from PostGIS in PyQGIS
I'm trying to read the St_AsBinary from PostGIS and to have a QgsGeometry.
I could have it working with this code:
import binascii
postgis_connection = "qgistest"
metadata = ...
0
votes
1
answer
222
views
Get Numpy array from SHAPE@WKB token
I am trying to get a numpy array from the SHAPE@WKB token that is obtained either using FeatureClassToNumpyArray or cursors, however what I get does not make much sense.
Specifically I am interested ...
1
vote
2
answers
2k
views
WKB structure does not match expected size
I'm running an Alteryx workflow where I am pulling data from one database to another PostgreSQL database containg PostGIS. However, when I run the workflow and write the data to the database, I am ...
2
votes
1
answer
100
views
"Perforated" polygon voids are filled when using OpenLayers with WKB geometries
When I try to draw a "perforated" polygon using GeoJSON.readFeatures() the "solid/void" relationship is drawn correctly, the void parts don't have any fill color. See the example, ...
4
votes
1
answer
3k
views
Python - Shapely to convert 2 columns to WKB
I have 2 columns in a CSV called Longitude and Latitude which are being parsed using my Python AWS Lambda Code.
I am using the shapely module with the following code to convert the long/lats into ...
1
vote
1
answer
1k
views
Converting Latitude/Longitude to WKB with Python
I have a CSV containing longitude and latitude and was wondering how I can use python to convert them to WKB to provide me with location data?
I know it can be done in PostgreSQL using UPDATE mytable ...
3
votes
1
answer
958
views
Decode SRID information from a PostGIS WKB string in Python using the standard library
TL;DR
I want to decode a WKB string which comes from a PostGIS database using the Python standard library. The WKB string seems to actually embed the SRID information, but I'm not 100% sure and ...
0
votes
1
answer
1k
views
GeoServer WMTS WKB error when QGIS reads PostGIS fine
Is there some problem that can make PostGIS point geometry unreadable by GeoServer WMTS? The points are generated with st_makepoint with lon/lat float args.
I'm especially confused because I have ...
3
votes
1
answer
2k
views
How to find and remove invalid geometry in a multilinestring python geodataframe?
I have original data as a 700000's rows excel, with geometry data in hexwkb format.
I want to plot it and make some spatial operations on it like intersect, distance and buffer, on a jupyter notebook.
...
1
vote
1
answer
961
views
Replacing WKT with WKB in PostGIS query & Shapely
I am extracting a geometry (type geometry(Geometry,4326)) from a PostGIS database. I managed to plot them from a GeoPandas GeoDataFrame using the following code :
cursor.execute("SELECT id, ...
3
votes
1
answer
687
views
Dealing with PostGIS WKB in PyQGIS
From QGIS I am running analysis on linestring geometry in PostGIS, and the result is updated geometry. I want to update the linestring only in editing mode of QGIS layer, so the user can decide ...
5
votes
1
answer
318
views
Pasting more than one geometry at a time in Quick WKT plugin for QGIS
I have a CSV of WKBs that I need to convert to WKT.
Can I paste them all into Quick WKT at the same time?
How do you break the spaces between geometries?
Page break, comma, semicolon, etc. do not ...
5
votes
2
answers
2k
views
PostGIS doesn't automatically convert WKB to GeoJSON
I discovered that somewhere in the upgrades from PostgreSQL 9.5 and PostGIS 2.2 to PostgreSQL 12.1 and PostGIS 3.0 the behavior for transforming a row into JSON changed.
I am using the following ...
13
votes
4
answers
31k
views
Reading geopackage geometries in Python
Let me state up front that I'm totally new to the field of GIS. I'm doing a project involving a database of buildings and their geometries in my home country (the Netherlands). At the moment, I'm ...
1
vote
0
answers
338
views
What could be a proper and simple invalid WKT/WKB geometry?
We are converting a geometry table to another one and we would like to convert every invalid geometry to a single one easily identifiable by users in WKB or WKT form and not breaking the processing or ...
0
votes
1
answer
2k
views
Viewing MSSQL data in QGIS
I am working with spatial data stored in an MSSQL 2012 database as varbinary. I am able to view the spatial data in SSMS with the following query:
SELECT geometry::STGeomFromWKB([column_name], 4955) ...
0
votes
1
answer
2k
views
MSSQL performance with Geography (point within polygon)
I have a query, below, that works - however its very slow, looping through roughly 24,000 points per second. This is a rather high end production DB server with MSSQL and SDE, and in other instances a ...
1
vote
1
answer
719
views
Converting GPX data stored in CSV into geography data type (WKB or WKT)?
I have a CSV that contains some data relating to hikes undertaken by various people. For each hike, there is an ID, max_elevation, length, start_time, end_time, and GPX field (along with some other ...
4
votes
0
answers
2k
views
Implicitly convert Geometry to WKT string in PostGIS
Suppose I have a table defined as follows:
CREATE TABLE gtest (name varchar, geom geometry);
To insert, I am able to simply do this:
INSERT INTO gtest
VALUES (
'Polygon',
'SRID=4326;POLYGON(...
2
votes
1
answer
547
views
PostGIS geometry to GEOS geometry without lwgeom dependency?
I've been looking for ways to convert PostGIS to GEOS geometries without linking to or dependency on lwgeom/liblwgeom.
The closest thing I can find is a mention of the pointcloud approach here:
...
0
votes
0
answers
2k
views
GeoPandas ParseException: Invalid HEX char error
I am trying to read a geospatial table from a PostGIS database on PostgreSQL.
Using the funcion
sql = '''SELECT ST_AsText(geom) AS geom FROM my_table;'''
df = gpd.GeoDataFrame.from_postgis(sql, ...
0
votes
0
answers
636
views
Getting well known text from varchar in redshift.
As you know, redshift does not support geometry types. There is a column in a dataset on my redshift db that has varchar column and the format looks like:
...
1
vote
2
answers
2k
views
including SRID in WKBWriter in Shapely doesn't work
I want to encode coordinates of LineString in WKB with the SRID included
wkbwriter = shapely.geos.WKBWriter(shapely.geos.lgeos, big_endian=False, include_srid=True)
geo = wkbwriter.write_hex(...
2
votes
1
answer
2k
views
GeoServer can't determine native CRS from PostGIS db with wkb_geometry column
I am trying to extract a banks layer from daily OSM extract pbf files for Nepal. After using osmosis and ogr2ogr, I was able to get it into a PostGIS Database.
Here are the commands I used:
osmosis -...
4
votes
1
answer
2k
views
Is MULTICURVE geometry in WKT valid according to the standard and open source community?
We are using Oracle function (SDO_UTIL.TO_WKTGEOMETRY) for exporting geometry to WKT. Some geometries have MULTICURVE in WKT, like this one:
MULTICURVE (COMPOUNDCURVE (LINESTRING (3451418.006 5481808....
1
vote
0
answers
108
views
This functionality is not supported by Default spatial service. DevArt dotConnect for PostgreSQL error
I want to get geometry data as binary. Its give me an error {"This functionality is not supported by Default spatial service."}. I am searching but nothing found about it.
var ilces = db.MaksIlces....
2
votes
1
answer
2k
views
How to convert PostGIS WKB to Shapefile - Fiona 'Polygon' object not iterable error
I am relatively new to Python and programming and trying to create a shapefile using multiple WKBs queried from a PostGIS database. I am using psycopg2 to query the database and using shapely and ...
1
vote
0
answers
457
views
Importing GDB WKB geometry error (OGR Geometry Factory err:6)
I have prepared all my layers in File GDB (converted the projection to EPSG3857) and uploaded the entire File GDB to PostGIS.
Somehow, it returned errors described below
Yet, it is uploaded to my ...
0
votes
2
answers
753
views
Exporting WKB (geometry) to .txt using ArcPy?
How can I export WKB (geometry) to text file using arcpy (ArcGIS)?
When I use the examples that I found on the Internet, it doesn't work. Below it's the code I'd wrote:
## Import arcpy module
...
2
votes
1
answer
539
views
What is wkbType -2147483646 in QGIS?
I want to find out the wkbType of a layer, this is my code:
print layer.wkbType()
Usually when it is a line geometry layer, it would give me 2. But instead it is giving me -2147483646.
2
votes
2
answers
11k
views
PostGIS: Update table with st_geometryfromtext [duplicate]
I'm trying to update a column wkb_geometry in a table locations by creating a point from the eastings and northings cols from the same table. The database is PostGreSQL with PostGIS extension:
UPDATE ...
2
votes
0
answers
48
views
ARCPY loses Z when I use geometry WKB [closed]
I'm trying to convert a shape geometry to WKB within a arcpy.da.cursor for import it in a Postgis database. When I analyze the result I saw that arcpy give me a 2d geoemtry when I convert to WKB.
Is ...
2
votes
0
answers
2k
views
How to convert geometry to WKB in QGIS?
I have a shapefile with polygon type geometry. I want WKB format of the geometry values. Is there any such tool in QGIS so that without using gdal/ogr I can do this?
1
vote
1
answer
568
views
Print and write the WKB to another shapefile using OGR_G_ExportToWKB in C?
I want to convert the geometry to well known binary (WKB) format of my shapefile. I want to print and want to write it into another shapefile.
My code is:
#include <stdio.h>
#include <...
6
votes
0
answers
2k
views
Import CSV with WKB field to QGIS?
I have a CSV file with a column that is WKB, called WKB.
When I import it to QGIS (using "Add Delimited Text Layer"), there seems to be no option for WKB, and the file imports as pure CSV - no ...
5
votes
1
answer
856
views
PostGis and datatypes WKT
I dont't have any experience with the geographics databases so I hope that you be patiente with me, the thing is: I know that the datatype geography is used if all you care about is measuring ...