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

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!

Related

Mapbox geometries get degraded when exported to tilesets

I'm trying out Mapbox for the first time, and playing around with drawing some polygons in the dataset editor for export to a tileset. However, the polygons in the resulting tileset are not the same as what I create in the editor. The polygons are only very rough, simplified approximations of the originals.
In dataset editor:
In map layer as tileset export:
I understand that Mapbox does vector simplification at certain zoom levels, but these changes are not zoom-dependent. I zoom in all the way and the shapes are still like this.
Moreover, such extreme degredation of the geometries makes tilesets essentially useless for features that require any sort of accuracy, like property lot lines.
Am I missing something, or is this really the expected behavior? Is there really no way to get accurate geometries into a tileset?
UPDATE: It appears this is only happening with shapes I create by drawing in the Mapbox data editor. So far the geometries that I've uploaded as geojson files have gotten converted to tilesets accurately...
I suspect this is because the maxzoom is too low.
When you create a Mapbox Tileset, either by uploading GeoJSON directly as a new Tileset, or by exporting your your Dataset to a Tileset, Mapbox will try to guess an appropriate minzoom and maxzoom of the Tileset.
Sometimes the min/max zoom's used aren't suitable for the map you're trying to create. Since there is no way to specify a maxzoom in either of the two approaches the only alternative is to create your Tileset locally with https://github.com/mapbox/tippecanoe specifying an appropriate maxzoom for your data and then uploading the resulting .mbtiles as a Mapbox Tileset.

Visualising road segments as heatmap in Leaflet efficiently

I have data consisting of parts of road segments of a city, with different number of visits. I want to plot the data on a Map and visualise it in the form of a heatmap.
I have two related questions:
I have the data from Open Street Maps (OSM) in the form of pairs of node ID's, where node ID correspond to the unique ID being assigned to a point by OSM. I also have a mapping for each node Id to its corresponding coordinates. Is there any Leaflet or Mapbox utility or plugin, which can plot a trip / highlight the road segment using 2 node ID's. I can always do it manually (by using the coordinate mapping and converting it into GeoJSON), but the problem occurs with the line width -- I have to make it exactly overlap with the width of the road, so that it seems that I am highlighting a road segment.
Is there any plugin / utility for Leaflet or Mapbox, which can be used for plotting polylines or geojson as heatmap efficiently? My current approach is calculating the color for each polyline and encoding that as a geojson property. But the problem is that with the increase in the number of lines (> 1K) the rendering becomes a pain and the method is not feasible. There are some plugins for Leaflet out there for plotting heatmap, but all of them are for points only and not lines. Any approach using WebGL would be really great.
An approach which I thought of could be converting my data into a shape file, upload to Mapbox Studio and use as a layer directly. But I have no idea how to go about doing that i.e. creating a shapes file, encoding the information in such a way that the complete road segment gets highlighted in the correct color.

Slimmer OSM maps with less data

I am bringing up a tile server with renderd/Mapnik/postgresql. Everything works fine, the problem is that I have no option to restrict my map to a specific region - I need the whole world to be available. On the other hand, I really do not need all the data that the map has (roads, ski slopes, terrain, etc). The planet OSM file is too large, and it takes days to import it to Postgresql.
Is there an option to prepare or to get from somewhere a slimmer OSM map file that will contain only borders and cities?

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.

Converting images from one geospatial coordinate system to another

I'd like to stack the images from this map: http://earthquake.usgs.gov/regional/nca/soiltype/map/ from linear projection into a leaflet map. The source tiles are in known but nonstandard zoom levels, and leaflet maps want mercator mercator XYZ tiles. In principle, I know how to do this - I have functions for changing XY coordinates into lat-lng coordinates in the two maps, and I just need to map pixels for the target map in terms of pixels in the source map.
This is unfortunately nontrivial, as the source pixels are spread across hundreds of different image files, and I am trying to put them into hundreds more images. Is there a software package that makes this a little bit more straightforward? If there is no library for dealing with this kind of data, it seems like there really should be...
Postgis has the RT_ST_Transform method, which under the hood uses GdalWarp. So, you have at least these two options. If you use Postgis, you will need to actually register/import the images into Postgis, using raster2pgsql and then call RT_ST_Transform on each one and then dump them out again -- which could be scripted to some extent using plpgsql (Postgres's scripting language). There is something of a learning curve involved with using Postgis raster, which may be worthwhile if you plan to do any other image processing analysis. You could also write a shell script (or similar) to automate gdalwarp if you don't wish to go the Postgis route.
For a less formal method than gdalwarp (an excellent program), you can check out the Leaflet plugin Leaflet.imageTransform, that can transform and image on the fly in the browser.