Geoserver with Mapstraction - geoserver

Do someone know how to use a custom hosted Geoserver's Tile Layers or WMS layers to be laid on Mapstraction as a base layer?
MapStraction has base layer plugins for google, yahoo, microsoft, openlayers etc., But unfortunately it lacks a plugin for custom open layers on geoserver. Do any one know how to neatly implement such a plugin?

Managed to find how to do the above.
Made a Copy of mxn openlayers.
Changed the TMS url to WMS where the geoserver is hosted. There would be 2 urls of OSM and OSM Mapnik, kept only one of them and replaced with the WMS Url.
There was only one problem in calling toProperietory and fromProperietory calls. Did not honestly understand the logic, but replaced them with just returning same values
And it worked.
PS: If someone understands the logic behind step 3, please feel free to explain.

Related

How to design content repository in Liferay for access by remote application?

I have two separate Java applications A and B running on different physical servers.
On application A (based on Spring Boot framework ) end users view images and image meta data (over 50k images) and has search functionality including faceted search and will use elasticsearch for this. In this application what is the best way to design the content repository ( storage of images and meta data) such that all images can be cached in memory for high performance access?
Application B:
This is liferay 7 based portal.
Authors uploads images and enter meta data about images (or blogs) such as image description Admin approves/publishes the images. These published images are immediately seen in application A. How Liferay can store images to make it possible? Note that application A cannot use Liferay.
For the second part of your question:
Liferay has an API, that you can use to interface with the rest of the world - e.g. even event based: When an image is approved, do something.
Also, images stored in Liferay have a URL - no need to store them somewhere else, you just need to refer to their URL to access them. I'm not sure if that counts as "Application A uses Liferay", you can judge that.
The first part of your question, "what is the best way to design the content repository?": IMHO that part of the question is far out of scope for stackoverflow.com as there tends to be no "correct" answer, but just personal opinions. There's by far not enough information to come up with a proper answer on this topic.

How to enable cross origin resource sharing (CORS) in Cesium Sandcastle for Geoserver WMS Get request

I am trying fist to test and practice in cesium sandcatle with my data on localhost:8080 geoserver.
This picture will explane everything
Also, i want to ask, "how to get a list of GeoServer layers loaded into the Cesium BaseLayerPicker"
From example http://localhost:8080/geoserver/masterrad/wfs?request=GetCapabilities give XML file, with possible layers in workspaces 'masterrad'. How to extract names from that XML and put in BaseLayerPicker
Thanks
I think this may be two unrelated questions, but I'll try to answer both.
You can enable CORS in Geoserver using the CORS Filter plugin:
http://software.dzhuvinov.com/cors-filter-installation.html
As for your second question, Cesium does not have built-in support for querying WFS GetCapabilities, but TerriaJS does:
https://github.com/TerriaJS/terriajs
TerriaJS is an open-source library built on top of Cesium that was originally developed for Australia's NationalMap and has since been used for a lot of other projects. TerriaJS also has a fallback to Leaflet for systems that can't run Cesium. Once you have CORS working on your server, visit nationalmap.gov.au (a site running TerriaJS), click Add Data, enter your WFS URL, and you should see all of the server's layers appear at the bottom of the Data Catalogue.

Spring 4: Individual view layouts depending on request

I am using Spring 4 MVC to display serve my web page. I now want to display the same content with different layouts wrapped around the body/content depending on the current HttpServletRequest (e.g. request.getServerName()). This means https://page1.test/page.html will be mapped to the same controller as https://page2.test/page.html and returns the same content depending on the controller logic, but page1.test draws for example a different header and footer.
As far as I know, Spring MVC is not capable of doing this. I am now planing to use Apache Tiles 3 or JSP 2.0 tags to do this. Is there any best practice and how can I do this (Spring Java Config is preferred)?
You should take a read of http://tech.finn.no/2012/07/25/the-ultimate-view-tiles-3/ just to see how far you can push Tiles-3
Indeed it can solve what you're after.
(That blog website has just been migrated from wordpress to github pages so some of the code snippets require horizontal scrolling, we're still cleaning these small formatting issues up so please excuse them)

Cache GeoServer is not working. How to solve?

I'm not able to work satisfactorily with the cache for GeoServer WMS. The WMS we are curling refers to the state of Goiás and often to present this layer takes few seconds. We also created a SLD to hover in a given municipality and sometimes gets to take 20 seconds to change the SLD.
I opted for better detail the problem including prints of the images in the document link:
https://docs.google.com/a/geoinova.com.br/document/d/1YSUPg21P0EZb78G0ojX77mUSpPiJld7Fg7za9CVsB28/edit
Could anyone guide me in this regard how to proceed?
I thank the attention.
Diego.
You may need to check the cach settings in geoserver and make sure the inline caching is enabled. Or you can use a different url to get to the layer.
If you normally access layers like this
http://example.com/geoserver/wms
Then try this instead
http://example.com/geoserver/gwc/service/wms
The gwc stands for GeoWebCache.
For more information on turning on direct caching or using the url see this.

How do I create a changing image for my website?

Not long ago I came across this website: http://www.danasoft.com/
This websites provides dynamically updating signatures which are pretty cool in my opinion.
There is just one thing that I don't get and would really like to know how to do.
Here's a direct link to an image on the website: http://www.danasoft.com/vipersig.jpg Try refreshing. Notice it changes? How do I achieve that? How do I have a direct link to a file like www.mypage.com/thing.jpeg output different images each time?
Basically, the URL is not actually retrieving the file directly each time, but rather the server is intercepting that URL and serving a (possibly random) image from a larger set of images. Depending on whether the server is running Apache, IIS, etc, the implementation could vary... This could also probably be achieved with the MVC routing engine by defining a custom route handler for URLs ending in '.jpg', but I'm not actually sure.
EDIT:
See this discussion for more detail on the MVC implementation.

Resources