OpenLayers 3 - Source with multiple available projections - openlayers-3

Is there anyway to specify a (Tile)WMS source that supports multiple projections?
For example, my WMS server supports requests for both EPSG:4326 and EPSG:3395. So if the projection is supported in server-side, the tiles are requested with the appropriate projection, else OpenLayers tries to reproject one of the supported projections.

You can use the client side reprojection to do that, see this example .
Just add a projection property to your ol.source.TileWms.

Related

Does "HERE Maps API for JavaScript" fully supports GeoJSON format?

Does API supports holes in GeoJSON?
I have GeoJSON which is rendered with holes on geojson.io but when I render the same data within H.data.geojson.Reader it is rendered without holes.
I haven't found any information about additional options or so in API Reference and no questions related to this problem here on StackOverflow.
Shall I provide my code and data or someone knows whether holes are supported or not?
Check the example which shows the holes with polygon, also to convert the result geometry into geoJSON object.
oGeoJSON ()Object
To obtain a GeoJSON representation of the given geometry.
See:
GeoJSON spec
Returns:
Type Description
Object A GeoJSON Geometry object representing the given geometry.

Does Imagemagick have functions to redraw/distort images to the various map projections? ie mollweide, mercator, orthographic

I searched the Imagemagick documentation for this but could not find references to standard geographical map projections. There are other applications that do this, but not with IM's level of precision. "Matthews Map Projection software" is a good example. I wish to use IM in a script to demonstrate these projections applied to fictional world maps.
It seems such a natural thing for IM to cover. Considering all the other distortions available, maps would be right up its alley. example projections: mercator, mollweide, orthographic, gnomonic...
link to MMPS
http://www.users.globalnet.co.uk/~arcus/mmps/
IM does not have cartographic projection functions yet.
Other open source software can suffice.
Matthews Map Projection Software
http://www.users.globalnet.co.uk/~arcus/mmps/
And xplanet
http://xplanet.sourceforge.net
Have command line options that are scriptable.
Displacement maps, the -fx function, and the -process function are other avenues.

What is the best options for tippecanoe to process line string features?

I have a GeoJSON file with a FeatureCollection (more than 300 000 features) of LineStrings. It is a road traffic records. I need to convert it to the MVT format using Tippecanoe. I'm trying to convert the GeoJSON with this params:
tippecanoe data.geojson -pf -pS -zg --detect-shared-borders -o data.mbtiles -f
Then I uploading it to Mapbox account as a tileset and use to render with Mapbox GL JS. And there is a problem - not all the features are visible. Moreover, if if will reconvert the GeoJSON file - then I will get a different result! So - what is the best options to use with tippecanoe to convert all the features (lineStrings) without oversimplification to use it with Mapbox GL JS?
P.S. One more thing which I noticed is that datasets uploaded with Mapbox Studio and then converted to tileset has some info like this: "This layer contains mostly LineStrings", but with my own tilesets converted with the tippecanoe I see a next message: "* No dominant geometry type*"
-ae will auto-increase the maxzoom if features are still being dropped at that zoom level. But when zoomed out it doesn't always look good depending on the type of features (e.g.: mising cadastre doesn't look good)...

restricting WMS tile extents

I'm brand new to openlayers, I've just been reading the docs today since I have a need to do some testing with it. I'd like to know if there's a way in openlayers to restrict the maximum geographic extent in a WMS tile request.
I've read that WMS bounding boxes are generated automagically, which is neat - but I have some issues with WMS requests on very large datasets which tend to make the underlying WMS server struggle. That's not really change-able, so we need to work around it, and one strategy is to request only small subsets at a time (~5 or 10 degree squares at most).
So - is there a way in openlayers to say 'get me at most 5 degrees by 5 degrees in a single WMS request, and build my map layer from those'?
Thanks in advance
Yes, you can set extent for your layer in such way:
new ol.layer.Tile( {
extent: ol.proj.transformExtent([30, 30, 50, 50], "EPSG:4326", "EPSG:3857"),
// your WMS source and other code
Please, make sure to use right projection. Example was given in case your map is in web mercator.

Converting from Albers to GPS coordinates

I have some coordinate data and the only thing i know about its coordinate system is the
following description:
PROJCS["Basic Albers NAD83",
GEOGCS["GCS_North_American_1983",
DATUM["D_North_American_1983",
SPHEROID["GRS_1980",6378137.0,298.257222101]
],
PRIMEM["Greenwich",0.0],
UNIT["Degree",0.0174532925199433]
],
PROJECTION["Albers"],
PARAMETER["False_Easting",0.0],
PARAMETER["False_Northing",0.0],
PARAMETER["Central_Meridian",-96.0],
PARAMETER["Standard_Parallel_1",45.5],
PARAMETER["Standard_Parallel_2",29.5],
PARAMETER["Latitude_Of_Origin",23.0],
UNIT["Foot_US",0.3048006096012192]
]
this comes from a prj arcGis file.
I need to convert from this system to GPS (Google maps) system and vice-versa.
this must be done programatically and i cannot use esri libraries (license issues)...
Could you explain the meaning of all these parameters?
are the coordinates expressed in the spheroid and the projection (albers) used only when drawing
the map? or the coordinates depend on the projection used also?
Do you know an open source library I could use for this transformation?
Thanks!
All these parameters define the projection, including:
Projection type (Albers)
GEOGCS defines the geoid (idealized Earth shape) used by the project. In this case, it's NAD83, which uses degrees for units and is centered at the Greenwich, the 0th longitude.
Where the projection itself is centered
How far the projection is moved north and east to make any negative coordinates
positive (False Easting and False Northing)
Units for coordinates in this projection (US Feet)
Some other information about how coordinates of the projection were transformed to be drawn on a flat service.
I have a blog post which goes over the details for an OGC WKT definition, which is very similar to the content in an ESRI .prj file: http://www.dev-garden.org/2011/07/30/projections-for-programmers-one-projection/. You may find it useful.
With projected coordinates, they have already been 'drawn on the map', and you need to reproject them to use in other coordinate systems like Google's projection.
There are many open source tools you can use to reproject your coordinates from one projected system to another. Here are a few:
Geotools or Proj4j - Java
Proj4js - Javascript
Proj - C or C++
dotspatial - C#
One command line tool I find very useful is ogr2ogr. Using ogr2ogr, it is very easy to reproject coordinates from one system to another. Here's how to convert a projected shapefile to a Google Earth projection:
ogr2ogr -f "ESRI Shapefile" -t_srs EPSG:3857 NEWFILE.shp OLDFILE.shp
Ogr2ogr uses the .prj file to determine the current projection of the shapefile, and then reprojects it to Googles projection, defined here by the EPSG shorthand EPSG:3857. You can find ogr2ogr for Windows and other platforms at http://fwtools.maptools.org/

Resources