I am looking for a way to create a geojson file from the distributions of the health sectors in my region which are different than any political division readily available on osm:
There are fantastic tools such as geojson.io to draw custom polygons but because of the complexity I would need a tool that allows me to overlay an image to use it as a template or that does this automatically. If this makes a difference, I may be able to extract the silhouette with any computer vision library but my problem of how to get from an image or shape to geojson still remains.
Which is the fastest way to approach this?
You can do this using QGIS with manual georeferencing in order to assign real-world coordinates to an image without geo-information. This is done by clicking points on a map that correspond to points on your image. Then once georeferenced you can export the file as a geojson.
Another solution is to find a shape file (maybe this is correct) and simply convert the .shp into a geojson.
Related
I downloaded the UN population density raster map (the 2020 prognosis) from here. I want to open this data in QGIS and have it projected correctly, but I can't seem to figure out how.
The following files are in the archive:
Files in archive
I am not sure what the xml files are for, but I know the tfw file is used to georeference the image so that the pixel coordinates can be mapped to WGS84 coordinates.
If I open the gpw-v4-population-density-adjusted-to-2015-unwpp-country-totals_2020.tif, which appears to be the main file, as raster file in QGIS, I get a correctly georefenced outline of the landmass of the world, but without any values representing population density (see here).
If I open the gpw-v4-population-density-adjusted-to-2015-unwpp-country-totals_2020.tif.ovr as raster file in QGIS, I get the population densities, but without proper georeferencing (see here). Strangely, this file seems to contain all relevant information, but is 1/4 the size of the other file, which seems to be useless.
How can I open the files in such a way that I have the population densities with the correct georeferencing? I thought QGIS would know how to do this automatically, but apparently not...
I think the problem is not that the data aren't loading in the first image, but rather, that they aren't being displayed the way you think they are.
Because the histogram of the population values is strongly skewed, QGIS loads 0,0 as the min,max values and everything shows up as black.
Try going into the style tab of the layer properties, and changing the "min" and "max" values to something like 1 and 50.
Alternately, you could classify them manually by changing the render type to "singleband pseudocolor" Like this image here
I need to generate a transparent image to apply on map similar to these:
Image_1or Image_2
I need to generate this image from a dataset: I have many data points (with lat and long) and I would to generate this image (server side) to show density on map of my data.
Know you something (libraries, or best way to solve my problem) about it?
Those are heatmaps. Google Maps already has this capbility, so you should check out their sample and the documentation. It can be as basic as loading in your data points and applying them as a layer or you can do much more customization.
I have a dataset with several hundred thousand lat/long points. I would like to render these points on a map for info-graphic purposes (as small dots or something similar).
This is not something that necessarily has to be interactive, or rendered in a browser. It's okay if it's just an image.
I know that attempting this with markers and Google maps would be tough... any other tools out there that would generate this type of map? Preferably free/open source?
Or, do you have a method to make this work with something like Google maps? I don't want to use a marker clusterer... I need to be able to see all of the points.
In short :)
Download and fire-up Quantum GIS
Add some background map (e.g. OSM WMS layer from http://129.206.228.72/cached/osm)
Have your data in a CSV file, in WKT format, and load it on top (using add delimited text layer)
Save as image
You might want to peek what stackexchange.com has on GIS, too.
I have this map
I managed to extract each country in different png file and I made this map by using AS3 code to place each country in its own place. It works properly but there is one thing I don't like and that is the quality of the images. You clearly see gaps between some countries and some borders are thicker than others. That is because I did the extraction with free hand.
Is there a way to get more clear boundaries with code and export the result in png file for each country?
Maybe using some map services like Google maps?
I would recommend you to use vector images instead; you can find some in the SVG format (easily convertible) on Wikipedia:
http://upload.wikimedia.org/wikipedia/commons/b/b3/Blank_map_of_Europe.svg
Each <path></path> node in the file refers to a country, where the id attribute contains the country code and the d attribute is the path in the SVG format.
The question is pretty descriptive.
I am working on a website that provides locations for filming.
All the data in the site is currently stored in a MySQL database including geocode data for google maps.
I need to show polygon areas for the different london boroughs that has locations.
I have all the data as kml files, idealy i would like to store this in the MySQL database.
I have had success using fusion tables to display this data, but it seems silly to me to have to have this data duplicated on google just to use a fusion map layer, can i simply use a kml layer to render this data rather than having to create a fusion table and rendering it from that?
If so, is there a resource someone could point me to for more information?
UPDATE:
Thank you for the responses so far, i thought i would update the question with a little more info .
I eventually want to have all the areas displayed at the same time on my map and then when an area is clicked on ideally it would take you to another page on the website showing locations for that specific area.
I had initially tried using KML layers but i was getting errors saying my KML was invalid.
The KML was initially stored in a field in my database table, i think probably the errors were due to me not understanding exactly how google read in the KML data.
Using polygons would be far simpler to implement as i can get this data via JSON and then render the polygons from that.
I know now its not possible to have info windows with polygons, but i would just prefer to jump directly to another website page with info for that particular area using a click handler rather than show an info window.
Alternatively as suggested showing a tool-tip with a brief description of the area and a link to the page would be better, how the tooltip itself, is it possible to render on top the map?
I am slightly worried that I will reach the layer limit for the KML.
Is it possible to have multiple polygons rendered with KML on one layer, or do i need a separate layer for each clickable area?
The Google Maps API provides a pretty straightforward method to draw polygons.
Basic Example:
var polygon = new google.maps.Polygon({
map: your_google_map_instance,
paths: array_of_latlng_points,
fillColor: "#336699",
fillOpacity: .5,
})
EDIT: For this approach, you would need to parse your KML files (sorry, must've missed that when I first read it). You can import the KML files to a KML layer
You can overlay Polygons using KmlLayer, FusionTablesLayer (as you know), or native google.maps.Polygon objects.
KmlLayer and FusionTablesLayer render them as tiles, so for lots of Polygons (if you only need click events) will be more efficient. There are limitations on the number of KmlLayers that can be displayed on the map at one time and on FusionTablesLayer (but those don't seem to be causing you problems).
There are also third party parsers available for KML (geoxml3, geoxml-v3) which will take your KML and render it as native google.maps.Polygon objects. For lots of Polygons, this will be less efficient than tile based rendering, but it does allow mouseover/mouseout, and changing the properties of the Polygons dynamically.
You could also try data layers what have lots of events so you can display tooltips, info window, status text on various mouse events.
See samples in documentation:
https://developers.google.com/maps/documentation/javascript/datalayer
If you have many polygons (where the actual value of many depends on multiple factors, can be anywhere between 100 and 1,000) the best is to use a built in layer type. The fastest are the ones rendered on server, e.g. kml layer because this doesn't create hundreds of DOM elements in browser but still exposes click events so infoboxes can be displayed for each item.
In the worst case you can implement your own rendering with an image map, obviously by using an existing library like mapnik.
https://developers.google.com/maps/documentation/javascript/maptypes#ImageMapTypes