[postgis-users] Invalid endian flag value encountered error since 2.1.7

Benjamin Börngen-Schmidt benjamin at boerngen-schmidt.de
Wed Apr 15 13:52:24 PDT 2015


Okay my bad!

The statement should have been ST_GeomFromEWKB(*E*'\\x0102000020e... 
then it seems to work see 
http://www.postgresql.org/docs/9.4/static/datatype-binary.html for 
reference.

Also the exception I was getting in my app was due to my error, so this 
can be closed.

- Benjamin

Am 15.04.2015 um 21:56 schrieb Benjamin Börngen-Schmidt:
> Hello Folks,
>
> since I updated postgis to 2.1.7 I get an error saying "Invalid endian 
> flag value encountered error" on my gentoo box.
> Postgresql 9.4
> Postgis 2.1.7
> POSTGIS="2.1.7 r13414" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 
> 6 March 2012" GDAL="GDAL 1.11.1, released 2014/09/24" LIBXML="2.9.2" 
> LIBJSON="UNKNOWN" RASTER
> For the database connection from my app I use pyscopg2 with the 
> statement ".... ST_GeomFromEWKB(%(route)s) ..." where route is a 
> memoryview fetch with the statements below.
>
> I imported the Openstreetmap using OSM2PO and then the application 
> runs these SQL:
>
> BEGIN;
> WITH info AS (SELECT end_point AS start, start_point AS dest FROM 
> de_sim_routes WHERE id = 177751) SELECT d.id, s.id FROM  (SELECT 
> id::integer FROM de_2po_vertex ORDER BY geom_vertex <-> (SELECT geom 
> FROM de_sim_points WHERE id = (SELECT start FROM info)) LIMIT 1) AS 
> s,  (SELECT id::integer FROM de_2po_vertex ORDER BY geom_vertex <->    
> (SELECT geom FROM de_sim_points WHERE id = (SELECT dest FROM info)) 
> LIMIT 1) AS d;
>
> CREATE TEMP TABLE route ON COMMIT DROP AS SELECT seq, source, target, 
> km, kmh, clazz, geom_way FROM   pgr_dijkstra(
> 'SELECT id, source, target, cost FROM de_2po_4pgr, (SELECT 
> ST_Expand(ST_Extent(geom_vertex),10000) as box FROM de_2po_vertex 
> WHERE id = 4560384 OR id = 4560672) as box WHERE geom_way && box.box',
> 4560384,
> 4560672,
> false,
> false) route
> LEFT JOIN de_2po_4pgr AS info ON route.id2 = info.id;
> -- For seeing the bytea as hex, the app would save the line as 
> memoryview (python) to an object and then use it later on
> SELECT ENCODE(ST_AsEWKB(ST_LineMerge(ST_union(geom_way))), 'hex') FROM 
> route;
>
>
> CREATE TEMP TABLE filling (target integer, station_id character 
> varying(38)) ON COMMIT DROP;
> INSERT INTO filling (station_id) SELECT id FROM de_tt_stations AS s
> WHERE ST_DWithin(s.geom, 
> ST_GeomFromEWKB('\\x0102000020e86400005a000000ba83cd0bc3b12141b18884c635515541eada439bd8b1214197ca2762365155419577f651f1b121417fd81bc2365155417c6695fff7b12141790f763735515541eb5191e1feb12141799bd67136515541ec32a3f7f0b121410298d9f63a515541fbc8b0bd0bb3214140d5cab4425155413ddf3d015ab321412b201ad9445155418ba1ce10a7b3214187f4e899465155411a1311ebfbb321417b32b95a47515541d5f460114bb521410f3d86cd45515541e3da2a5c92b72141058b1e1a4351554135d586d583ba21418a244eb81f51554192e6a95550bb2141f42009e813515541414ff1da79bc2141d759f6d403515541b0fc7742d0bc214159ed702aff505541f06fe57f0dbd21413eabc5abfa50554196516e7349bd21416821f256f5505541a04372d887bd2141044e59f0ed505541f102ee9bd5bd2141623ae6a2e5505541a565bec722be214175bca05fe2505541a8ad742580be2141eff80826e05055414528db2319bf2141a05ea26cdd505541ecfde45977bf214104fcf0a4dc5055418c22317dcdbf21415edf93bcdd50554175d6129547c0214180df76cbdd505541379e13a9e1c02141832e0f46db5055417468c1a295c12141c2b34763d7505541bfaaa2e85dc22141828fa78fd0505541c749aec0dec221412cd9 
> 0 
> 4b2cb5055410e64fad481c32141ae7342e9c4505541d1863345aac321415239df06c350554186093cfecec32141a0ee5585c05055416bc72ea75fc421413a462e98ac505541fadd10d7cfc42141853112a6a0505541e16e28f624c52141ec496a8795505541d093d2a73cc5214158cf3a0c935055413a28343c6bc52141ca4e01cf905055418e6a6d46a6c52141b93ae9048f505541746f16c1e6c52141bbc5c3ad8c505541377259202bc621413048b06d8950554196664371c0c62141e19a7c7881505541c91033f8eec72141040ccf7270505541f1f71ca20fc8214198e614316f50554197720f7034c821410ede86ca6e5055414a4c083152c8214171a20d716f505541f6ae2eb27ec821419c32808e725055418ea6795bacc82141c3223ca476505541046d96c9cdc82141375a17e2775055411ce999e3eac8214194966a9d77505541ac2f05f6e8c92141b83f990c6c505541213e404916ca214180f5cae36a50554173d2fce13fca2141c43836926a50554191643f4847cb214190b2c0296a50554184fdc3bb39cd21419818f98f6e5055417f7ad6424dcd2141602801bc6e505541239e538d5bcd21410c4b23dc6e50554179f946a57acd21418382a8226f5055410c1f253847cd2141434f794975505541ecea751c43cd2141a891c4fa75505541e017989c35cd21410a9fe13f785 
> 0 
> 5541cd17689929cd21416c8d44987d505541be7c2fc8c9cc2141d00178a1a05055414e828534c7cc214113d8e292a1505541fa697804b6cc2141afec66d1a450554193a5b3ada2cc21415724bd35a7505541e2a389b83ecc21413a77ef7eac5055419f459d1115cc21411925b385af5055410945663de1cb21416bfac247b450554174ace6d5bccb2141239322f5b85055418e473f47aacb21417ea53541bc5055413aad7636a9cb2141baf8d67ebd5055413b89ee68b3cb2141d671d26fbf50554110bceaaad1cb2141512b33f6c3505541176140b2c7cb2141c69cb70dd3505541fe8cee0fc3cb2141ceb14458d6505541744d8fbfb7cb2141288a3239da505541352058c3aacb2141f6ed3a0cdd505541cf124ca191cb2141f76a8aace0505541500bae2e6dcb2141eb79c073e3505541a8f2aaf4f5ca2141078352cbed5055411e7e6846e8ca2141868d10d0ee505541bc8bc3d8e5ca21414493e2d6e95055411a854d99e4ca2141064bd3cae0505541bf0029e8e3ca21416679d729de5055416b4c9ef79fca2141ff7f906fde50554138b96c1367ca2141f3d9362dde5055410e001d5105ca21418ad78591de5055415d9e949ffec9214111a5ad22de505541d2c0ac3dfcc92141780cd277d9505541'::bytea), 
> 1000);
> UPDATE filling SET target = (SELECT id::integer FROM de_2po_vertex 
> ORDER BY geom_vertex <->   (SELECT geom FROM de_tt_stations WHERE id = 
> filling.station_id) LIMIT 1); SELECT target, station_id FROM filling;
> COMMIT;
>
> Funny thing is, this does not always happen and I really do not have a 
> clue how to debug this. Is there a way to downgrade to 2.1.5 or an 
> earlier version?
>
>
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20150415/bc848657/attachment.html>


More information about the postgis-users mailing list