Posts

Showing posts with the label GeoServer

Publish PostGIS Layers in GeoServer Automatically using cURL and REST

Disclaimer: The idea came from this blog . So, what's the difference? I'm using Windows.  cURL should be installed already. If you have lots of tables in your database that you wanted to publish in GeoServer, you can use this method. Just prepare a list of tables (separated by new line) you want to publish in a text file format. Before proceeding in publishing layers, you need to setup a workspace and store in your GeoServer first. Although this can be done using cURL and REST API, but it is more convenient in that way. After a minute.... :D :D Create ".bat" file Use the code below but (of course) change the necessary inputs for /f %%a in ( <list of tables you want to publish> .txt) do  curl -v -u <username> : <password>   -XPOST -H "Content-type: text/xml" -d "<featureType><name>%%a</name></featureType>" http://localhost:8080/geoserver/rest/workspaces/ <name of workspace> /datastores/...

Accessing GeoServer in a Local Network in Windows

Image
Using these following installers: step1. insert following xml nodes into ../webapps/geoserver/WEB-INF/web.xml <filter> <filter-name>cross-origin</filter-name> <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class> </filter> <filter-mapping> <filter-name>cross-origin</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> step2. unzip Jetty-bundles-repository-9.0.5.v20130815, and find two jar files in ./lib dir: jetty-util-9.0.5.v20130815.jar, jetty-servlets-9.0.5.v20130815.jar (because “org.eclipse.jetty.servlets.CrossOriginFilter” is in jetty-servlets-9.0.5.v20130815.jar package, which depends on jetty-util-9.0.5.v20130815.jar package) step3. copy these to jar files to “.../geoserver/WEB-INF/lib”. step4. restart GeoServer. ALL DONE! The above instruction will allow you to use WFS, of course, you need to enable the service in ...

GeoDjango + GeoServer + Openlayers Combo!

Image
I am developing this web mapping application using Django(GeoDjango), Openlayers and PostgreSQL(PostGIS plugin). It is quite good but when having a huge set of data(shapefile/rows in the table/polygons with multiple vertices) it is "laggy". Panning and browsing on the map and rendering of layers is too slow. I have read some articles about it that although Openlayers has no limitation in rendering a vector(feature) layer, the browser does. So, I decided to use GeoServer. Here's my framework for now: Before, I get my GeoJSON data from Django and rendered it directly using Openlayers but since it is, as I said "laggy" the visualization of the map now is from GeoServer (WMS). HUGE difference, in terms of its rendering performance. It is quite good but I need to learn more about tuning it and use native JAI for rendering images. And also, performing PostGIS queries(ST_Intersects, etc...) is slow, I have tried using raw sql for it but still the response...