Why is Tippecanoe conversion of geojson file to pbf vector tiles resulting in incorrect lat/long placement? - mbtiles

I'm trying to generate pbf vector tiles from json data using tippecanoe. Ultimately will be served up for use in OpenLayers but had no success there so tried testing the tiles in QGIS. When I view any of them (in QGIS) instead of being in the longitude range of -180 to +180 they are in the ~2000 to ~4000 range.
I have a simple json file consisting of a rectangle surrounding Europe using EPSG:4326.
I use tippecanoe to generate the pbf tiles.
jim.json consists of:
{"features":[{"geometry":{"coordinates":[[0,0],[0,80],[80,80],[80,0],[0,0]],"type":"LineString"},"properties":{"level-index":1,"level-value":956.0,"stroke":"#a52a2a","stroke-width":1,"title":"956.00 "},"type":"Feature"}],"type":"FeatureCollection","crs":{"type": "name","properties": {"name": "urn:ogc:def:crs:OGC:1.3:CRS84"}}}
Then I run this command:
tippecanoe --no-feature-limit --no-tile-size-limit --no-tile-compression -s EPSG:4326 --output-to-directory TilesDir --force jim.json
Then if I try to see if the tiles are correct, I take the largest one (0/0/0.pbf) into QGIS and the rectangle gets plotted outside of the earth out at 2000degE instead of in the expected area near Europe.

It turns out that QGIS is not the appropriate tool to test the pbf. After correcting some other issues, I was able to display the pbf in OpenLayers. I assume tippecanoe generates the pbf with some internal coordinate system (4096x4096 pixels?) not the EPSG:4326 that I was expecting.

Related

Digitizing a raster against OSM , issue with ballpark transform or technique?

I've pulled up a 'plot of land' raster and I'm attempting to georeference it to Openstreetmap. I can get the raster and the OSM to line up however it isn't accurate enough - there are straight lines that have warped.
I'm assuming this is an issue relating to the message, "Used a ballpark transform epsg:27700 to EPSG:3857" that I get when I add OSM as a layer to a new project set to EPSG27700.
As you may easily tell, I'm quite a novice at QGIS!

Extract Images from Bing Maps using QGIS

I have extracted shape files with polygon coordinates in geojson format for a particular area. Now I want to use this shapefile in qgis to extract individual images from Bing Maps corresponding to Polygon coordinates.
How to do that?
If you want to clip the exact area from the Polygons, i think you can't extract them from Bing Maps. You need the raw data.
On the other hand if you are just fine with an image of the area of the Maximum bounding box of your Polygons you could calculate these and than automatically clip them from the WMS server.
I had a similar problem where i downloaded several building shapefiles from Open Street Map and needed to get an image for each building from annother WMS server with aerial images (e.g.Google Satellite). In Qgis load in the Bing WMS server and your shapefiles then you can click on your specific polygon in the attribute table and zoom to this Polygon. This will set the Qgis map canvas to the Maximum Bounding Box containing your shape. Then you go to "Project" -> "Save as image" and you can save this screen as a image, tiff, png... Of course you can automate this using the Python consol:
from qgis.PyQt.QtCore import *
l=range(0,90)
for i in l:
x=int(i)
layer = iface.mapCanvas().currentLayer()
layer.select(x)
qgis.utils.iface.actionZoomToSelected().trigger()
layer.deselect(x)
name=str(x)
qgis.utils.iface.mapCanvas().saveAsImage('yourpath'+ name +'.png')

tilemill creates jagged edges for worldmap

Trying to create a custom world map texture with tilemill to load into leafletjs. I have downloaded a free .tiff file from natural earth data and loaded it into tilemill.
When i want to export however, i notice alot of jagged edges mainly around greenland/canada on the lowest zoom level.
a few zoom levels down and it seems ok again. After exporting the tiles to png's the jagged edges stay. How can i improve the quality of these images?
How can i improve the quality of these images?
By using more detailed input data.
By the looks of it, you are projecting a raster image in EPSG:4326 projection into the EPSG:3857 "web mercator" projection. In the original data, each pixel spans the same amount of longitude and latitude degrees. In a mercator projection, each pixel spans the same amount of longitude, but a different amount of latitude. The artifacts you are experiencing are akin to a Tissot's indicatrix.
You can try using a different value for the raster-scaling symbolizer option in your tilemill stylesheet, but that's gonna make the artifacts different, not get rid of them.

Newbe help on getting from polygon shape file to Leaflet polygon

Learning Leaflet. Had success with point data. Now want to create polygons.
The process starts with an Access record with a Parcel Identification Number. Using ArcMap desktop, the records are joined to a parcel shape file for the county.
What the best approach to get to Leaflet polygons from here? Like with point data, do I need to add fields to contain the lat/lon data?
I don't need a lot of detail; just a pointer in the right direction. I don't mind doing homework.
My approach would be to convert the shapefile to geojson and then load the geojson into your Leaflet map.
I'm aware of some ArcGIS plugins to export geojson, but an alternative approach is to use the command line tool GDAL (ogr2ogr).
See the links on this answer for more details, but the command will end up being something like the following...
ogr2ogr -f GeoJSON -t_srs "EPSG:4326" [name][.geojson|.json] [name].shp
From there you can preview the results in geojson.io or github before creating your Leaflet map.

Convert/Warp raster imagedata from EPSG31466 to 4326 for OpenStreepMap overlay

I have a raster image in Gauss Krüger 2 projection that I need to use as overlay in OpenStreetMap and learned so far that I need to warp/translate/convert the image using tools like GDAL.
I tried gdalwarp with the following results:
$ gdalwarp -s_srs 'EPSG:31466' -t_srs 'EPSG:4326' kg2-map.png osm-map.tiff
ERROR 1: Unable to compute a transformation between pixel/line
and georeferenced coordinates for /kg2-map.png
There is no affine transformation and no GCPs.
What do I need to do in order do get this task done?
You need to georeference the PNG source file, so that each pixel has a coordinate and resolution. If you know the coordinate of the top left corner and the resolution, make a 6-line world file named kg2-map.pngw or kg2-map.pgw.