Showing posts from March, 2017

Revamped Our Rainfall Monitoring System

I had mentioned that I was digging ReactJS in my last post, so I applied what I have learned about it to revamp our rainfall monitoring system.

It's funny how we code last day, month or year is very much different compared today. It's not bad though, that means we're (I'm) improving or there's a progress. The system before uses JavaScript, JQuery, Openlayers and  a JavaScript library for date formatting.

Here's how it works:
Request data from a different (an external) domain(server)Get the latest value and append it to the pre-defined GeoJSON objectEvaluate the value to determine its rainfall intensity Finally, plot it on the map Downside, upon clicking each points, the system needs to request again the data to display it in graph.

Now, like I said, there's a progress.

Aside from using ReactJS, I also changed how it works.
Request data from a different (an external) domain(server).Get all the data (not just the last value) from all available stations and sto…

My Adventure with ReactJS and Django I

I am digging ReactJS these past days. I am trying to figure out how it works this is because of my curiosity looking at the source code of a certain website with clean html structure--like having just a head, body and a division within it only. I was wondering how the HTML elements have been rendered on that page, and there I found out that it is possible by using ReactJS (I don't know if there are other library that can do it).

Just an introduction what is this ReactJS--it is developed by Facebook (made it more appealing to me). If they are using it, therefore, it must be really efficient and fast. As the description on the website states, it is "A JavaScript library for building user interfaces". Based on my understanding, it utilizes the Virtual DOM, meaning instead of directly changing or re-rendering the DOM when updates is needed,  ReactJS will determine and calculate if there are changes in the UI in Virtual DOM and if there is, it will re-render the entire UI in…

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/<name of store>/fea…