Mabox Outdoors custom style with Mapnik - maps

I am trying to set up a tile server with Mapnik, renderd, mod_tile and with MapBox Outdoors style. I've been able to successfully go through https://switch2osm.org/serving-tiles/manually-building-a-tile-server-14-04/ tutorial and set up the server with OSM-Bright style.
Next I changed renderd.conf file and pointed the 'XML' property the 'project.xml' file from MapBox Outdoors style which I previously downloaded from Github. I've also cleared the cache, restarted renderd and apache but the new style does not work - there are only empty tiles rendered.
Is there something that I'm doing wrong? What is the proper way to apply Outdoors style?

The Mapbox Outdoors style is not compatible with the OSM Bright process described by switch2osm. It is designed to be uploaded to a Mapbox account, not to be used with a custom mod_tile setup. The style as-is relies on data in the form of vector tiles served from the Mapbox API (which requires an account / API key and is subject to certain conditions).
It would be possible to modify the source code to work with a custom database for you to use it in your own tile server setup, but you would need to make sure your layer definitions are compatible with the descriptions at https://www.mapbox.com/developers/vector-tiles/mapbox-streets/ and https://www.mapbox.com/developers/vector-tiles/mapbox-terrain/.

Related

Content Management Api to POST media files from external source

I am looking for a solution in episerver to add media files from external sources into episerver.I am aware that episerver has recently released Episerver Content Management API to post contents within Episerver.Is it possible to use this for media files as well.As this is newly introduced in episerver, i cant find any references other than the documentation within epi which has more of CRUD operations on Content.Can someone please point out some reference links for me to get this started?
Any input is appreciated.
Regards,
The content management API is useful if you want to create a headless website that talks to Episerver via an API to get content.
Depending on what you want to use the media for will depend on the optimal approach. I assume you want the content editors to be able to pick these items from within the CMS? If so there are two main appraoches:
You could write a scheduled task using the content repository API to import the media into the Episerver media library
The other option is to create a content provider, so the media is available in the editor, read this to learn how to do it. This option is more fidley so I would go with option 1 if possible.
If you just want to render images on a web page, then call the API using AJAX. Job done!

Custom tile server - how to create a layer using Mapnik and mod_tile using POSTGIS db

I have created a Ubuntu 14.04 tile server.
I loaded an OSM base map into the POSTGIS database and created a slippy-map using OpenLayers 3.9.
Then I loaded data of an overlay into the POSTGIS database and now I am trying to create a layer for it.
To create layers, the only solution with decent documentation seems to be Tilemill.
But to use Tilemill on my server I have to use "SSH connection forwarding", explained here.
I don't want to create a security leak into my server.
Are there any other options, with decent documentation, with which I can create custom layers for my map?
What I already 'know':
Create a simple map with Mapnik
Store shape files into the POSTGIS database
Use OpenLayers to display the layer
What I need to know:
I have a simple overlay (created with Mapnik):
This overlay has to be rendered into different tiles and have zoom levels, just like a OSM base map. I want to use this overlay and put it over an area on my OSM-tiled map.
What do I need to be able to create a layer that can be displayed with OpenLayers like:
url: '/overlay/{x}/{y}/{z}'?

adding legend on GeoServer

I am new to GeoServer and I am trying to add a legend on an existing map. I am not sure where to add the legend XML file?
In the GeoServer user manual, they briefly talk about legend but it is not very clear: http://docs.geoserver.org/stable/en/user/advanced/wmsdecoration.html
I think the legend XML file should be added in the web map services page (WMS). But I tried to search for the key word like legend or something on the page but I cannot find it. Am I on the right direction?
You are referring to WMS overlay decorations.
In the link http://docs.geoserver.org/stable/en/user/advanced/wmsdecoration.html that you included in the post, it gives the instructions needed to mimic the screenshot you've referenced.
To use decorations in a GetMap request, the administrator must first
configure a decoration layout. These layouts are stored in a
subdirectory called layouts in the GeoServer Data Directory as XML
files, one file per layout. Each layout file must have the extension
.xml. Once a layout foo.xml is defined, users can request it by adding
&format_options=layout:foo to the request parameters.
In essence, you:
create a descriptor file like what is offered in your post
Copy this file to the layouts folder that exists in the Data Directory on
the Geoserver (the specific path varies on the installation)
craft requests for the wms layer with querystring parameters to instruct
the server that you want to see the layer with the specified
overlay. i.e. &format_options=layout:foo to the request parameters.
This embeds the overlay onto the layer itself. This is in contrast with Jose's answer which involves an additional HTTP request (which could be referenced in a <img href=""/> tag).
In either case, the legend component can be influenced by also applying a style in the request for the layer. These are commonly coded with SLD. For information on that is available here
== Edit 01 ==
For Reference, the path to the data directory can be found here:
This is the path on the server where geoserver is installed where the data directory resides. The Structure of Data Directory link has some detail on what is in this folder and the purpose of each item.
I think the request you are looking for is GetLegendGraphic. With this request you are requesting Geoserver to return an image that corresponds to the default SLD of a layer or to a SLD specified in the request.
This is a sample request that you can find in the Geoserver documentation:
http://localhost:8080/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=topp:states&legend_options=fontName:Times%20New%20Roman;fontAntiAliasing:true;fontColor:0x000033;fontSize:14;bgColor:0xFFFFEE;dpi:180
For more information and all the parameters that you can specify in the request:
http://docs.geoserver.org/latest/en/user/services/wms/get_legend_graphic/legendgraphic.html
If you are looking for a request to get the SLD file content instead of an image to handle it in the application you will need to do a GetStyle request.
I hope that helps.

Simple integration of Bing Maps into WPF application page

How would I go about integrating Bing Maps into a page or frame in my WPF application? I have found a lot of resources for Bing Maps development, but I don't need to develop with Bing Maps, just add the actual thing into my application without hyper-linking out to the website.
Windows 8 applications do this with "contracts" with other metro apps but I do not see a similar functionality with WPF applications.
Thank you!
Just go here and download the control :)
http://msdn.microsoft.com/en-us/library/hh750210.aspx
The control is in the "Bing Maps WPF Control SDK"
If i remember correctly you will need to register for an api key.
UPDATE:
to get the api key you have to register here https://www.bingmapsportal.com/
This was a lot easier than I expected, #Tjofras had a correct answer but here is some more elaboration:
1) Get a Bing Maps developer key for free here - https://www.bingmapsportal.com/
There is a trial version that gives you all the features, but for a limited time and there is a basic version that is free but has limited features.
2) Create a project in Visual Studio for Desktop
3) Check out this article for step-by-step instructions and the exact lines of code to integrate it into your project.
This line goes at the top of your MainWindow.xaml page :
xmlns:m="clr-namespace:Microsoft.Maps.MapControl.WPF;assembly=Microsoft.Maps.MapControl.WPF"
Add the map into your existing grid with your developer key, initial latitude and longitude values, and an initial zoom level with the tags:
m:Map object
CredentialsProvider tag (your developer license code)
Center tag (initial latitude and longtitude)
ZoomLevel tag (how zoomed in you are)
Browse the API's and make your application awesome!

How to save esri map as an image file

I am using Silverlight 3 and I am trying to take a screenshot of esri map.
I was able to take a screenshot and save as a file for silverlight controls, but when I try to access Esri map image, I get "Pixel access not allowed" error. I heard this is because of different domain (I am trying to get map image on the client side, and map image is not accessible at server side in my silverlight application).
So I am trying to find a function from esri so that I can save the map image as a file.
does anybody know how to do this? or any other way around?
I am using a script from the Code Gallery for both printing and exporting map images.
The script requires a little bit of tweaking to get it to work (plus you need to dig a little bit into WCF and self-hosted services), but it has been working great for several months now. You can see it in action at our web site.

Resources