[Geoserver-users] KML templating possibilities

Hi all,
I have one specific question about the kml generation.
I am interested in generated a custom kml (using templating freemarker…)
However one thing is that i don’t want to only specify and but i would like to specify an attribute in the feature like

Is that possible, Any pointers?

Thanks

Gersh

Ok, I had a look to the code, and it is not possible.
However it could be something interesting to trace the feature, because we manage to make transaction between google earth and geoserver…
we can get it however with styleUrl tag, or other possibility is to apply xslt after the wms call (a bit like kml_reflect do).

Gersh

On 28/08/07, gershwinou < gershwinou@anonymised.com> wrote:

Hi all,
I have one specific question about the kml generation.
I am interested in generated a custom kml (using templating freemarker…)
However one thing is that i don’t want to only specify and but i would like to specify an attribute in the feature like

Is that possible, Any pointers?

Thanks

Gersh

Hi Gersh,

The only thing I can think of us to use the fid of the feature as the
placemark id.... Would that work? Or are you looking for more flexibility?

-Justin

gershwinou wrote:

Ok, I had a look to the code, and it is not possible.
However it could be something interesting to trace the feature, because
we manage to make transaction between google earth and geoserver...
we can get it however with styleUrl tag, or other possibility is to
apply xslt after the wms call (a bit like kml_reflect do).

Gersh

On 28/08/07, *gershwinou* < gershwinou@anonymised.com
<mailto:gershwinou@anonymised.com>> wrote:

    Hi all,
    I have one specific question about the kml generation.
    I am interested in generated a custom kml (using templating
    freemarker...)
    However one thing is that i don't want to only specify <description>
    and <name tag> but i would like to specify an attribute in the
    feature like <Placemark id="my id">

    Is that possible, Any pointers?

    Thanks

    Gersh

!DSPAM:4007,46d41f22231605210051143!

------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

!DSPAM:4007,46d41f22231605210051143!

------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,46d41f22231605210051143!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Hey Justin,
yeah, that is what i think, put the fid as id of the placemark. Then:
the user can’t change it because he does not see it anywhere, unless he edits the kml file.
If the user sends back this feature modified, we can update the data repository.

btw, i am interested in using postgis versioned. but i can’t figure out how to do that. What i understood so far:

  • i should create myself the complementary tables (no script for that?)
  • on top of that i may run geoserver (geotools datastore). Question: can i query the wfs/wms to get the last version of the features or some tagged version? (something like http://localhost/geoserver/wms?..normalquery…&tag=1.0)
  • is WFS-T supporting that on commiting a feature back to the server (on top of postgis versionned); Should be yes if
  1. postgis versionned datastore is transparent ie datasource.addfeature(feature) actually increase version of a the feature if the fid match the one in database…
  2. WFS-T is able to send back somehow the fid when you commit a modified feature.

thks for the help

Gersh

On 28/08/07, Justin Deoliveira <jdeolive@anonymised.com> wrote:

Hi Gersh,

The only thing I can think of us to use the fid of the feature as the
placemark id… Would that work? Or are you looking for more flexibility?

-Justin

gershwinou wrote:

Ok, I had a look to the code, and it is not possible.
However it could be something interesting to trace the feature, because
we manage to make transaction between google earth and geoserver…
we can get it however with styleUrl tag, or other possibility is to
apply xslt after the wms call (a bit like kml_reflect do).

Gersh

On 28/08/07, gershwinou < gershwinou@anonymised.com
mailto:[gershwinou@anonymised.com](mailto:gershwinou@anonymised.com)> wrote:

Hi all,
I have one specific question about the kml generation.
I am interested in generated a custom kml (using templating
freemarker…)
However one thing is that i don’t want to only specify
and but i would like to specify an attribute in the
feature like

Is that possible, Any pointers?

Thanks

Gersh

!DSPAM:4007,46d41f22231605210051143!



This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

!DSPAM:4007,46d41f22231605210051143!



Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,46d41f22231605210051143!


Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Hi Gersh,

gershwinou wrote:

Hey Justin,
yeah, that is what i think, put the fid as id of the placemark. Then:
the user can't change it because he does not see it anywhere, unless he
edits the kml file.
If the user sends back this feature modified, we can update the data
repository.

Makes sense to me. Can you throw this in as a feature request?

btw, i am interested in using postgis versioned. but i can't figure out
how to do that. What i understood so far:
- i should create myself the complementary tables (no script for that?)
- on top of that i may run geoserver (geotools datastore). Question: can
i query the wfs/wms to get the last version of the features or some
tagged version? (something like
http://localhost/geoserver/wms?....normalquery...&tag=1.0
<http://localhost/geoserver/wms?....normalquery...&tag=1.0&gt;\)

There are some docs here on trying out versioning... but i am not sure
how recent they are. Here is what I suggest you do:

1. Grab the latest 1.6.x nightly build from:

http://geo.openplans.org/nightly/trunk/

2. Grab the "versioning" configuration / data directgory from :

http://svn.codehaus.org/geoserver/trunk/configuration/versioning/

In there is a 'spearfish.dmp' file which is a postgis dump. From there
you can import the .dmp and point geoserver at the versioning data
directory. From there you can checkout the demo request page for example
s of how versioned requests look.

- is WFS-T supporting that on commiting a feature back to the server (on
top of postgis versionned); Should be yes if
1. postgis versionned datastore is transparent ie
datasource.addfeature(feature) actually increase version of a the
feature if the fid match the one in database...

My understanding is yes... the intent being that you can point your
existing wfs-t dont have to change.

2. WFS-T is able to send back somehow the fid when you commit a
modified feature.

Yup, wfs-t does this without the versioning extensions.

thks for the help

Andrea will provide you with better answers then I can but hopefully
this will be enough to get you started. Be sure to let us know if you
have any issues.

-Justin

Gersh

On 28/08/07, *Justin Deoliveira* <jdeolive@anonymised.com
<mailto:jdeolive@anonymised.com>> wrote:

    Hi Gersh,

    The only thing I can think of us to use the fid of the feature as the
    placemark id.... Would that work? Or are you looking for more
    flexibility?

    -Justin

    gershwinou wrote:
    > Ok, I had a look to the code, and it is not possible.
    > However it could be something interesting to trace the feature,
    because
    > we manage to make transaction between google earth and geoserver...
    > we can get it however with styleUrl tag, or other possibility is to
    > apply xslt after the wms call (a bit like kml_reflect do).
    >
    > Gersh
    >
    >
    > On 28/08/07, *gershwinou* < gershwinou@anonymised.com
    <mailto:gershwinou@anonymised.com>
    > <mailto:gershwinou@anonymised.com>> wrote:
    >
    > Hi all,
    > I have one specific question about the kml generation.
    > I am interested in generated a custom kml (using templating
    > freemarker...)
    > However one thing is that i don't want to only specify
    <description>
    > and <name tag> but i would like to specify an attribute in the
    > feature like <Placemark id="my id">
    >
    > Is that possible, Any pointers?
    >
    >
    > Thanks
    >
    > Gersh
    >
    >
    >
    >
    >
    >
    ------------------------------------------------------------------------
    >
    >
    -------------------------------------------------------------------------

    > This SF.net email is sponsored by: Splunk Inc.
    > Still grepping through log files to find problems? Stop.
    > Now Search log events and configuration files using AJAX and a
    browser.
    > Download your FREE copy of Splunk now >> http://get.splunk.com/
    >
    > !DSPAM:4007,46d41f22231605210051143!
    >
    >
    >
    ------------------------------------------------------------------------
    >
    > _______________________________________________
    > Geoserver-users mailing list
    > Geoserver-users@lists.sourceforge.net
    <mailto:Geoserver-users@lists.sourceforge.net>
    > https://lists.sourceforge.net/lists/listinfo/geoserver-users
    >
    >
    > !DSPAM:4007,46d41f22231605210051143!

    --
    Justin Deoliveira
    The Open Planning Project
    http://topp.openplans.org

!DSPAM:4007,46d489e734462092453641!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

gershwinou ha scritto:
...

btw, i am interested in using postgis versioned. but i can't figure out how to do that. What i understood so far:
- i should create myself the complementary tables (no script for that?)
- on top of that i may run geoserver (geotools datastore). Question: can i query the wfs/wms to get the last version of the features or some tagged version? (something like http://localhost/geoserver/wms?....normalquery...&tag=1.0)
- is WFS-T supporting that on commiting a feature back to the server (on top of postgis versionned); Should be yes if
1. postgis versionned datastore is transparent ie datasource.addfeature(feature) actually increase version of a the feature if the fid match the one in database...
2. WFS-T is able to send back somehow the fid when you commit a modified feature.

Instructions on how to setup a versioning WFS are here:
http://docs.codehaus.org/display/GEOS/Trying+out+the+early+WFS-V+prototype.

The short version is that you create your own standard postgis database,
populate it with data, and connect to it with the versioning datastore.
On connection, the versioning datastore will alter the structure of
your database, adding extra tables as well as extra columns in your datasets, as well as modifying the primary keys (so beware to what database you connect to).

The datastore works much alike Subversion, with a global revision number
that gets increased each time you commit something to it, and each
row that has two revision numbers, the revision it was created at, and
the revision when it ended being the "current one" (the current one
has maxint as that number).

Whilst this capability is not exposed thru GeoServer, the datastore
can transition any table from the versioned to the unversioned state
on demand (thus removing the extra columns, reinstating the old primary
key, and keeping only the current data). Of course, if you do so, you'll
loose history.

As for extracting data at a certain revision, there are examples in
the sample data dir referenced in the above document. You can perform
extractions at a certain revision both from WMS and WFS.

Oh, the WFS versioning support is experimental, so don't play with valuable data and please report back whatever you
find that does not look right.

Hope this helps
Cheers
Andrea

The short version is that you create your own standard postgis database,
populate it with data, and connect to it with the versioning datastore.
On connection, the versioning datastore will alter the structure of
your database, adding extra tables as well as extra columns in your
datasets, as well as modifying the primary keys (so beware to what
database you connect to).

Hey, that is great. Which mean that if i connect geoserver 1.6 beta2 with postgis versionned, it will create the proper tables… good. It is a bit dangerous, but fullfill my request. I would have seen something on postgis side, like the function addgeometrycolums(). It would be makeversioningtable(tablename)… anyway good enough. Do you think about feedback refractions so they can move on supporting versionning as well.

The datastore works much alike Subversion, with a global revision number
that gets increased each time you commit something to it, and each
row that has two revision numbers, the revision it was created at, and
the revision when it ended being the “current one” (the current one
has maxint as that number).

Whilst this capability is not exposed thru GeoServer, the datastore
can transition any table from the versioned to the unversioned state
on demand (thus removing the extra columns, reinstating the old primary
key, and keeping only the current data). Of course, if you do so, you’ll
loose history.

good, that solve almost my previous remark.

As for extracting data at a certain revision, there are examples in
the sample data dir referenced in the above document. You can perform
extractions at a certain revision both from WMS and WFS.

I’ll check out and tell you…

Oh, the WFS versioning support is experimental, so don’t play with
valuable data and please report back whatever you
find that does not look right.

Sure! Thanks again Andrea

Gersh

gershwinou ha scritto:

    The short version is that you create your own standard postgis database,
    populate it with data, and connect to it with the versioning datastore.
    On connection, the versioning datastore will alter the structure of
    your database, adding extra tables as well as extra columns in your
    datasets, as well as modifying the primary keys (so beware to what
    database you connect to).

Hey, that is great. Which mean that if i connect geoserver 1.6 beta2 with postgis versionned, it will create the proper tables.... good. It is a bit dangerous, but fullfill my request. I would have seen something on postgis side, like the function addgeometrycolums(). It would be makeversioningtable(tablename)... anyway good enough. Do you think about feedback refractions so they can move on supporting versionning as well.

Nope. Basically I had to choose between trying to do something inside
postgis, using PL/SQL or whatever, or doing it in java and have it portable to other databases with relatively low effort (yes, I could port most of the versioning support to Oracle or MySql in a short time).
Given that I basically think in Java when it comes to programming, I haven't written a stored procedure in the last 6 years, and I have a history of trying to stay as away as possible from the dbms vendor of the day, the choice was a no brainer.
If anyone wants to recode everything in PL/SQL I would be happy to
re-create the java layer to delegate to it. That would open versioning
to other languages as well.

Cheers
Andrea

Actually you are right. Both approach make sense. Versionning is not even attached to postgis, could be enabled for postgresql tough.

But interesting concept. Because i guess the users of orcale or mysql can’t wait the their own versionning datastore !

Good job

Gersh

Nope. Basically I had to choose between trying to do something inside
postgis, using PL/SQL or whatever, or doing it in java and have it
portable to other databases with relatively low effort (yes, I could
port most of the versioning support to Oracle or MySql in a short time).
Given that I basically think in Java when it comes to programming, I
haven’t written a stored procedure in the last 6 years, and I have a
history of trying to stay as away as possible from the dbms vendor of
the day, the choice was a no brainer.
If anyone wants to recode everything in PL/SQL I would be happy to
re-create the java layer to delegate to it. That would open versioning
to other languages as well.

Hi everybody,

I have played a bit with postgis versionned both with geoserver and geotools. It works fairly nicely.
I have a couple of questions:

  • Say I have a features in my “versioned” table. However somebody gets the vectors (latest version) in his favorite map editor and discovers one is wrong. He changes the feature and commits back only this feature. The problem is that if i get the latest version now, i have only this feature twice (previous version+the newly updated). How to get only the last update (something probably with the gid somehow but i don’t know how)?
  • I have seen that you can get say the version 5 from the wms request adding &featureVersion=5. But how do you get diff. (&fromFeatureVersion=1 does not seem to work…)

Thanks for the help

Gersh

On 29/08/2007, gershwinou <gershwinou@anonymised.com> wrote:

Actually you are right. Both approach make sense. Versionning is not even attached to postgis, could be enabled for postgresql tough.

But interesting concept. Because i guess the users of orcale or mysql can’t wait the their own versionning datastore !

Good job

Gersh

Nope. Basically I had to choose between trying to do something inside
postgis, using PL/SQL or whatever, or doing it in java and have it
portable to other databases with relatively low effort (yes, I could
port most of the versioning support to Oracle or MySql in a short time).
Given that I basically think in Java when it comes to programming, I
haven’t written a stored procedure in the last 6 years, and I have a
history of trying to stay as away as possible from the dbms vendor of
the day, the choice was a no brainer.
If anyone wants to recode everything in PL/SQL I would be happy to
re-create the java layer to delegate to it. That would open versioning
to other languages as well.

gershwinou ha scritto:

Hi everybody,

I have played a bit with postgis versionned both with geoserver and geotools. It works fairly nicely.
I have a couple of questions:
- Say I have a features in my "versioned" table. However somebody gets the vectors (latest version) in his favorite map editor and discovers one is wrong. He changes the feature and commits back only this feature. The problem is that if i get the latest version now, i have only this feature twice (previous version+the newly updated). How to get only the last update (something probably with the gid somehow but i don't know how)?

If you don't specify version numbers in your requests you get back the
latest version only.

- I have seen that you can get say the version 5 from the wms request adding &featureVersion=5. But how do you get diff. (&fromFeatureVersion=1 does not seem to work...)

The diff is a new operation we created on the WFS side and that returns
either a human readable diff or a WFS transaction. Have a look at the
sample requests in the versioning data dir.

If you wanted a visual diff instead, it could be possible to create
one, but some coding is needed. The idea could be to display
the same layer twice, with different colors and some translucency,
so that one could spot which geometries have changed visually (but
that won't show you if the attributes have changed, that is something
you can get from the WFS versioning GetDiff operation above).

Cheers
Andrea