[Geoserver-jp] SQL View Feature
mario.basa ＠ gmail.com
2010年 9月 12日 (日) 06:16:55 EDT
I don't know if anybody is using it already, but I am having so much
fun testing the new SQL View feature of Geoserver 2.1-beta1.
What I did to test the new feature is to get the map data
japan_ver52.zip over at ESRI (gold sponsor of FOSS4G 2010 :-) here:
and import it to PostGIS.
Then I got statistics data from the National Census (平成17年 ) here:
and import some of the data from the from the Excel file into a
PostgreSQL table. I used the 市区町村コード(renamed to jcode) as the link
item with the japan_ver52 PostGIS table.
>From here, I created a PostGIS Data Store in Geoserver, and then
created the SQL View Layer using this sql string:
from census2005 a,japan_ver52 b where a.jcode = b.jcode
And that is it.
In older versions of Geoserver, this was a 2 process procedure: (1)
create a view in the DB, which usally strict DBAs will not permit, (2)
create a PostGIS layer in GeoServer using the view. This isn't very
efficient since if the view is changed in the DB, the layer info also
has to be modified in GeoServer.
Anyway, it is possible to view the sample census layer with the
thematic engine I did over here:
It is a slow machine though. Next I'll try using the dynamic parameters:
where pref = %pref% or where prefcode = %prefcode%
and pass the parameters from OpenLayers. Hopefully it can handle Kanji
characters, although I doubt it.