Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm looking for a (good) solution to solve the following problem:
provide users with a searchable map
search is constrained to street names
a statically known set of street names needs to be coloured in a specific way (e.g. some get a strong red, a soft red, a strong green, etc)
So the user's experience would be to search for e.g. his own street, and see which colour his and neighbouring streets have. A bit like your typical map hotspots functionality, but really focused on the street level.
A sketch of this idea:
Does anyone know any approach to get to this? Combine a dynamically searchable map with a pre-colouring of let's say 10k streets?
I've looked at bing maps, google maps, here maps, osm, but none of them really seem to offer what I'm looking for. I don't want to query specific coordinates of a specific street given the query of the user, and then draw polylines along those coordinates - I want a "pre-baked" map, that works just like a searchable normal map, but happens to colour streets in a specific pre-defined way.
I'm happy with any good approach, doesn't matter how complex (offline rendering, dynamic colouring, ...). I looked around for possible solutions, but anything I found was focused on either providing a static image, or colouring just one specific street using e.g. a directions API.
Thanks for any input!
A couple of approaches to do this. Most of the map platforms you mention provide their road maps as static image tiles which doesn't give you the data you to do what you want here.
If you must use one of those platforms you will need to find an alternative source for the road data, host it and pull it into your app and style it like any other shape. One catch though is it is very likely that the data you find won't line up 100% with the roads that are in the map images for various reasons such as generalization of data, vintage of data, and width/centering method used for the road line. You can hide many of these imperfections by giving your line more width.
If you aren't locked into one of the map platforms you mentioned, you might want to consider a platform that uses Vector tiles for the base maps instead. Azure Maps (the product I work on) as well as Mapbox, both provide this. Vector tiles are a newer data format which contains all the same data as a map tile, but is basically a mini geojson file that has been compressed (zipped). This allows the raw map data to be accessible in the client. Using data driven styles you can then use metrics that each piece of data has to specify how to style each entity in a tile. However, when you are zoomed out vector tiles optimize themselves and combine shapes and sort them into layers. For each, all highways of a certain type will likely be a single shape in a tile, and the only information you will have to style on is the source layer name. When zoomed in closer and the name appears on the road, that name information will also be available in the vector tile. So depending on how you want to style roads, based on class/layer or by name, the zoom level at which this will work will vary. I have test app here that provides insights into the map tiles:
https://azuremapscodesamples.azurewebsites.net/Experimental/Inspect%20Features%20under%20the%20Mouse.html
I have a bunch of samples on data driven styling here: https://azuremapscodesamples.azurewebsites.net/index.html however they all use GeoJSON data via a DataSource object. All the same styling also works with a VectorTileSource as well, its just a different source of data. One caveat is you need to know what properties exist inside the vector tiles so you can style it.
Related
I'm trying to determine the terrain type at an arbitrary location. If I make use of Google Maps for instance, I can visually see what terrain is forest, built up areas and water for instance by the colour displayed on the map.
I'm trying to see whether there's any sort of API call I can use to get this basic information. I don't need it to be highly precise and I don't really need to determine the exact terrain type (so stuff like the Corine Land Cover is pure overkill). I'm going to need to make a number of these requests every few minutes. I've found a previously asked question around 3 years ago which wasn't really resolved, I'm hoping that there's been a change now.
Is there anything I can use? I'm actually considering reading the displayed map tile myself and grabbing the pixel colour, but I'd appreciate if there was a simpler method.
It doesn't seem like they provided the API to do that..
A work around would be to use their static maps API.
basically after you turn off everything but the water and greens, you get something like this:
http://maps.googleapis.com/maps/api/staticmap?center=37.7833,-122.4167&zoom=10&format=png&sensor=false&size=640x480&maptype=roadmap&style=visibility:off&style=feature:water|element:geometry|visibility:simplified&style=feature:poi.park|element:geometry|visibility:on
you can, make the size to be 1px by 1px, zoom in, and check the color of this image to decide the type of area of this location.
I would like to draw a map of current temperatures (or air pressures, etc.) from many weather stations, with the underlying map still recognizable. the problem is easiest to think of as follows:
I have an array of spot measurements from irregularly spaced dots---think triples of GPS coordinates with one temperature value each. my stations can be very close to or very far apart from one another, and a user may want to zoom in or out. cold should be blue, warm should be red. Ideally, I would like to just pass the array, the color range, and have the rest be taken care of. I would prefer everything to be inside a web browser. The user needs to be able to zoom in, zoom out, move around, and get back to his current location.
I do not even know how to think about this problem. If a user has zoomed out enough, non-transparent dots could be so close as to obscure the terrain. However, zooming in, it would be nice to recognize the dot that is the station itself. This presumably requires some intelligence that realizes how many dots there are, e.g., relative to the density of the display? not sure.
I believe google maps charges for many API calls, so I would prefer using an open map and/or open API that can use different underlying maps. It does not have to be fancy. I don't care about directions, etc.---just a map that is recognizable at most zoom settings, with landmark and street names, and my nice temperature station overlay coloring, so that a user can visualize where it is cold and where it is warm.
(Stations come online and offline, but I don't need to update this more than once an hour. I can place the map measurements into a file that is URL web-accessible.)
is this an easy or a hard problem for the high-level web programmer?
/iaw
after looking around for a long time, I think the best way to do this is with html5 openlayers nexrad.
alas, the docs seem to be a mess. half the examples that I found did not seem to work. it's pretty hit-or-miss. similarly, the openlayers cookbook also seems to be outdated and has incorrect examples, but they did have a reasonably short example of such a nexrad map overlaid on the U.S., that one can further study.
I'm trying to show some data about Australian suburbs. 'Suburb' is the term that Australians use to describe an area, if you are from the rest of the world think post code or something similar.
I'd like to be able to get access to the area boundaries that are already in the map. These are examples of the kind of boundary that I'm talking about:
Marrickville, Sydney (2204): http://goo.gl/maps/QYRhx
Clapton, London (E5): http://goo.gl/maps/3an2Y
I want to be able to draw the boundary on the map, draw multiple boundaries on a map (e.g. show which areas make up the 'inner west'), shade the areas to indicate their vaue of something or other. Generally do stuff with them.
This question asks about how to get boundaries that are drawn manually, but I want to access the ones that already exist.
This question asks a similar question, but it isn't answered.
This question is similar, but the responses suggest using shape files, not getting them directly from Google.
I've also tried the maps styling wizard, and whilst the administrative, neighborhood boundary is what I need to show, it doesn't seem to be able to affect the map.
I've looked in the api docs to no avail. Does anyone know if this is possible?
No, it isn't possible.
The area boundaries feature is not (yet?) implemented in the API.
If you explicitly need data from Google then I can't help you.
But if you just need data on Australian suburbs and don't care where you get it from (and if you happen to be interested in SA or NSW) then you can get GeoJSON or KML for SA from data.sa.gov.au/data/dataset/suburb-boundaries and for NSW from data.gov.au/dataset/nsw-suburb-locality-boundaries-psma-administrative-boundaries.
You might find others at data.gov.au/dataset too, I haven't searched that much.
I want to create an online map for a hiking trail, and I have been using my smartphone to collect coordinates from it.
I have many questions regarding what's good practice when it comes to making such tracks, but for starters: it would look much neater if I could edit the readings so that they are right on top any roads in Google Maps. How can I achieve this?
EDIT: I want to find the coordinates that will make a track along a road look exactly as if I'm using snapping/directions even when I'm not.
I've tried tools such as QLandkarte GT and Viking, and with the latter I was able to manually remove excess coordinates and move the remaining ones so that they're exactly on top of roads (inside Viking, using OpenStreetMap). However when I load the edited .kml-file in Google Maps, the roads seem to be in slightly different places and the result is hardly better than before editing.
I tried using the hack that exports GMaps directions as .gpx, thinking I could insert Google's own coordinates along the roads. But the exported file only had coordinates at the turning points with straight lines between these.
QLandkarte GT supposedly has a snap-to-road feature (see answer in link), but I haven't found it and I also don't know how to obtain a vector map of the area.
Then there's Google Earth which people seem to use for this, but again I can't find any track editing features (in the free version).
In short:
How do I edit my existing tracks so that they match roads in GMaps...
OR
How can I obtain new tracks representing roads in GMaps...
...so that the resulting track is as smooth as Google's own directions or other professional GPS-data, when displayed in GMaps?
It seems like it's possible to get these coordinates from Google Maps after all, exporting the directions polyline. I'm not sure how, it seems to involve adding the parameter output=dragdir to the link.
Anyway there's a tool called GPS Visualizer that can create a .kml-file with the wanted coordinates.
Edit: Will accept my own answer as long as it's the only one, but I would still like to know more.
I have a custom Google map set up with custom markers for certain points with popup infowindows. I currently have it setup to show all locality labels (eg city/area labels) however the client has asked if we can hide certain localities and not others (so that the relevant areas of interest are always visible but the irrelevant ones are not). You can obviously set it to hide all localities (or other items on the map) but I cannot see anyway of only displaying certain ones? Does anyone know anyway of displaying certain ones and not others?
If this is not possible then presumably the only alternative would be to hide all locality labels and setup 2 different styles of markers, one that is a normal marker withpopup and one that is actually just a text label with no associated popup which can then be used to list the relevant locality labels? Presumably this is possible but is there a better way of doing it as this doesn't seem right?
Thanks so much,
Dave
I'm assuming from your description that you have created a MapTypeStyleapi-doc. And no, there is no easy way, using a Styled Mapdev-guide, to apply a style to specific geographic areas; it just provides the hierarchical model of styling rules.
To answer your specific question about how to create markers that function essentially as labels, the MarkerWithLabel utility library will provide you with a tool that does what you describe. That said, I wouldn't recommend trying to recreate a set of map labels for an area or region using markers; the misgivings you express in your question about this approach are valid.
If you need to implement something along these lines, I suggest taking a look at the following two options and considering if either of these are a good fit for what you are trying to achieve:
Custom Overlays
KML Layers