Using Openmaptiles Tileshrink tool with boundsfilter and negative latitude gives an error - openmaptiles

I am using the Openmaptiles tool Tileshrink-gl in Docker to downsize a mbtiles map file. While It's working ok with positive latitude and longitude values, I get an error while using a negative latitude value, e.g.:
docker run --rm -it -v $(pwd):/data tileshrink-gl maps/osm-2019-10-14-v3.10-south-america_colombia.mbtiles maps/curacao_lvl_14.mbtiles --bounds -68.601379,11.946632,-69.223480,12.425848 --maxzoom 14 -O -s maps/style_nothing.json
The error output is:
'--bounds' expects a value

TIP: Add quotes around the numbers in bounds.
UPDATE: --bounds="-68.601379,11.946632,-69.223480,12.425848"

Related

raster2pgsql: "Could not allocate memory for INSERT statement"

I'm very new to raster2pgsql so please bear with me. I'm trying to load a 60mb .tif (from the High-Resolution Settlements Layer project) to my postgis-enabled database with the following code:
raster2pgsql -s 5235 -C -F [path to the .tif] public.hrsl_lka | psql
-h localhost -U postgres -p 5432 -d project
However, I get the following error:
ERROR: insert_records: Could not allocate memory for INSERT statement
ERROR: process_rasters: Could not convert raster tiles into INSERT or
COPY statements ERROR: Unable to process rasters
Loading smaller .tifs of around 3mb to the same database but from other sources works fine, however.
Is there a size limit with raster2pgsql? I'm on PostgreSQL 12.4.
With many thanks,
Gregor
Have you tried setting the tile size -t?
According to the documentation:
-t: Tile size - expressed as width x height. If not provided, a default is worked out automatically in the range of 32-100 so it best
matches the raster dimensions. It is worth remembering that when
importing multiple files, tiles will be computed for the first raster
and then applied to others.
Alternatively you can let the script compute it for you by means of setting -t to auto e.g.
raster2pgsql -s 5235 -t auto -C -F file.tif public.hrsl_lka | psql -d db
Related answer: Are there limitations using a PostGIS out-db raster?

shp2pgsql gsid conversion issues

I'm fairly new to PostGIS. I've imported a shp file countless times in different ways. Here's my latest attempt.
shp2pgsql -d -s 4269 /var/www/Shape/Hamilton_City/Election_Poll_Boundaries.shp city_hamilton | psql -U postgres -d shape
I'm importing to srid 4269 because the .prj file says:
GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
When I do any type of search on the geometry of the polygons as in:
select ST_Astext(geom) AS coordinates FROM city_hamilton limit 1;
I get odd coordinates like:
MULTIPOLYGON(((574380.4001 4808575.0399,574434.7803 4808545.44,574496.2521 4808512.3351,.....
What am I doing wrong here?

Tensorflow for Poets | Relaunching Docker | invalid reference format

I'm a beginner, trying out Tensorflow for Poets. I have been following instructions to build my own image classifier. But I get an error while following Step 3 of the tutorial at here
When I run the following command in PowerShell:
docker run -it \ --publish 6006:6006 \ --volume ${HOME}/tf_files:/tf_files \ --workdir /tf_files \
tensorflow/tensorflow:1.1.0 bash
I get the following error:
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: invalid reference format. See 'C:\Program
Files\Docker\Docker\Resources\bin\docker.exe run --help'
I have tried passing home address instead of $HOME, tried even lower case for the address. But still I get the same error.
I'd appreciate thoughts and suggestions.
Thanks!

Mahout clustering: How to retrieve the name of a named vector

I want to cluster multiple documents using Mahout. The clustering works fine but I have no idea how to find out which documents are located in each cluster.
I read that you can use the option --namedVector when creating the sparse-files but where does it take the ID from and how can I retrieve this ID after the clustering is completed?
Right now I am doing the following steps:
I have a directory with a file for each document. The files are in the following format with the ID of the document as filename:
filename: documentID.txt
[TITLE]
[CONTENT]
I create a sparse directory with namedVectors using:
./mahout seqdirectory -i tmp/es-out -o tmp/es-out-seqdir -c UTF-8 -chunk 64 -xm sequential
./mahout seq2sparse -i tmp/es-out-seqdir -o tmp/es-out-sparse --maxDFPercent 85 --namedVector
Then I can cluster the results and create a dump:
./mahout kmeans -i tmp/es-out-sparse/tfidf-vectors -c tmp/es-kmeans-clusters -o tmp/es-kmeans -dm org.apache.mahout.common.distance.EuclideanDistanceMeasure -x 10 -k 20 -ow --clustering
./mahout clusterdump -i tmp/es-kmeans/clusters-10-final -o tmp/clusterdump -d tmp/es-out-sparse/dictionary.file-0 -dt sequencefile -b 100 -n 20 --evaluate -dm org.apache.mahout.common.distance.EuclideanDistanceMeasure -sp 0 --pointsDir tmp/es-kmeans/clusteredPoints
The dump looks like this:
:VL-190{n=1 c=[1:3.407, 110:6.193, 2007:3.736, about:1.762, according:2.948, account:3.507, acting:6.
Top Terms:
epa => 13.471728324890137
mountaintop => 11.364262580871582
mine => 10.942587852478027
Weight : [props - optional]: Point:
[...]
k-means in Mahout is only a toy.
You can use it for howtos and tutorials, but for real use it is too slow, too limited, roo hard to use. (Also, k-means results are not half as good as people think... most of the time they are dogfood.)
Benchmark other tools, and you'll be surprised big time.
I found a way. You can use the seqdumper to extract the cluster mapping:
./mahout seqdumper -i /tmp/es-kmeans/clusteredPoints/part-m-00000 -o /tmp/cluster-points.txt
Than you can use a regex to extract the mapping of the vector IDs to cluster IDs.

error "illegal option --t" occus when import OSM map into postgis [windows environment]

I want to import OSM map into postgis, so used the following command in windows cmd console:
osm2pgsql -U postgres -d osm -hstore -s _S ./default.style ./xxxx.osm
But "illegal option --t" error occus:
osm2pgsql illegal option --t
Usage error.
I don't know what's the meaning of "illegal option --t" and don't know how to handle it.
I've looked at several articles but haven't find any answer.
thanks.
p.s I've installed postgis 2.1.7 and postgresql 9.4 and hstore.
There are at least 2 mistakes in your command -hstore instead of --hstore and _S instead of -S .
So:
osm2pgsql -U postgres -d osm --hstore -s -S ./default.style ./xxxx.osm