Hi Nuno, list,
Thanks for the feedback. It is nice to know that it can’t be done with Hale
Studio as that narrows down the path by which I should work down.
But I’m unsure as how to do this using a mapping file.
I have tried to manually edit the mapping file that was generated by Hale so
that plu:member mapping looks like this:
<FeatureTypeMapping>
<mappingName>SpatialPlan-9bda274b-ea2e-4840-9660-39ed7564ac61</mappingName>
<sourceDataStore>dataStore</sourceDataStore>
<sourceType>plu_spatialplan</sourceType>
<targetElement>plu:SpatialPlan</targetElement>
<attributeMappings>
<AttributeMapping>
<targetAttribute>plu:member</targetAttribute>
<jdbcMultipleValue>
<sourceColumn>inspireid_localid</sourceColumn>
<targetTable> plu_spatialplan_offdoc</targetTable>
<targetColumn>fk_spatialplan</targetColumn>
<targetValue></targetValue>
</jdbcMultipleValue>
<ClientProperty>
<name>xlink:href</name>
<value>member_href</value>
</ClientProperty>
But I get an error when sending a getfeature request:
Error applying mapping with targetAttribute plu:member Could not find working
property accessor for attribute (offdoc_href) in object
As if the join doesn’t work.
Maybe this is not the right way of doing it, but I can’t decipher from the
documentation how it should be done.
I would like to end up with something that looks like this (where the
interesting part is the plu:member target in the bottom):
<?xml version="1.0"?>
<wfs:FeatureCollection xmlns:net="http://inspire.ec.europa.eu/schemas/net/4.0"
xmlns:sc="http://www.interactive-instruments.de/ShapeChange/AppInfo"
xmlns:lunom="http://inspire.ec.europa.eu/schemas/lunom/4.0"
xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:cp="http://inspire.ec.europa.eu/schemas/cp/4.0"
xmlns:hfp="http://www.w3.org/2001/XMLSchema-hasFacetAndProperty"
xmlns:gml="http://www.opengis.net/gml/3.2"
xmlns:ad="http://inspire.ec.europa.eu/schemas/ad/4.0"
xmlns:au="http://inspire.ec.europa.eu/schemas/au/4.0"
xmlns:base2="http://inspire.ec.europa.eu/schemas/base2/2.0"
xmlns:plu="http://inspire.ec.europa.eu/schemas/plu/4.0"
xmlns:ns1="http://www.w3.org/1999/xhtml"
xmlns:tn="http://inspire.ec.europa.eu/schemas/tn/4.0"
xmlns:base="http://inspire.ec.europa.eu/schemas/base/3.3"
xmlns:gmlcov="http://www.opengis.net/gmlcov/1.0"
xmlns:gn="http://inspire.ec.europa.eu/schemas/gn/4.0"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:gsr="http://www.isotc211.org/2005/gsr"
xmlns:gts="http://www.isotc211.org/2005/gts"
xmlns:bu-base="http://inspire.ec.europa.eu/schemas/bu-base/4.0"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:gss="http://www.isotc211.org/2005/gss"
xmlns:swe="http://www.opengis.net/swe/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wfs="http://www.opengis.net/wfs/2.0"
xsi:schemaLocation="http://inspire.ec.europa.eu/schemas/plu/4.0
http://inspire.ec.europa.eu/schemas/plu/4.0/PlannedLandUse.xsd
http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd"
numberMatched="5" numberReturned="5" timeStamp="2018-11-09T15:05:18.847+01:00">
<wfs:member>
<plu:SpatialPlan
gml:id="dk.plu.nationalpark.bddfc20f-4ad4-45da-853b-87f38e8ea0c1">
<gml:identifier
codeSpace="http://inspire.ec.europa.eu/ids">bddfc20f-4ad4-45da-853b-87f38e8ea0c1</gml:identifier>
<plu:inspireId>
<base:Identifier>
<base:localId>bddfc20f-4ad4-45da-853b-87f38e8ea0c1</base:localId>
<base:namespace>https://envi.data.gov.dk/1b33054a-b7a3-4c7e-b68c-3aa4f92b7997</base:namespace>
</base:Identifier>
</plu:inspireId>
<plu:extent>
…
</plu:extent>
<plu:beginLifespanVersion>2018-10-04T13:57:01Z</plu:beginLifespanVersion>
<plu:officialTitle>Regulation on National park Thy</plu:officialTitle>
<plu:levelOfSpatialPlan
xlink:href="http://inspire.ec.europa.eu/codelist/LevelOfSpatialPlanValue/national"/>
<plu:endLifespanVersion nilReason="other:unpopulated" xsi:nil="true"/>
<plu:validFrom>2016-06-29+02:00</plu:validFrom>
<plu:validTo nilReason="other:unpopulated" xsi:nil="true"/>
<plu:alternativeTitle>National park Thy</plu:alternativeTitle>
<plu:planTypeName
xlink:href="http://to.be.decided/PlanTypeNameValue/RegulationOnNationalParks"/>
<plu:processStepGeneral
xlink:href="http://inspire.ec.europa.eu/codelist/ProcessStepGeneralValue/legalForce"/>
<plu:backgroundMap nilReason="other:unpopulated" xsi:nil="true"/>
<plu:ordinance>
<plu:OrdinanceValue>
<plu:ordinanceDate>2016-06-28T22:00:00Z</plu:ordinanceDate>
<plu:ordinanceReference>Legal Force Date</plu:ordinanceReference>
</plu:OrdinanceValue>
</plu:ordinance>
<plu:officialDocument
xlink:href="https://envi.data.gov.dk/1b33054a-b7a3-4c7e-b68c-3aa4f92b7997#CK000808"/>
<plu:member
xlink:href="https://envi.data.gov.dk/1b33054a-b7a3-4c7e-b68c-3aa4f92b7997#c3faeacc-7435-4f48-9e68-487da6778d46"/>
<plu:member
xlink:href="https://envi.data.gov.dk/1b33054a-b7a3-4c7e-b68c-3aa4f92b7997#4c0e64e1-a320-45f8-a322-e8034932cf44"/>
<plu:member
xlink:href="https://envi.data.gov.dk/1b33054a-b7a3-4c7e-b68c-3aa4f92b7997#41ba0023-42a5-46e2-b972-1b286e4cfda8"/>
</plu:SpatialPlan>
</wfs:member>
Fra: Nuno Oliveira <[email protected]>
Sendt: 13. november 2018 17:26
Til: Jonas Nygaard Pedersen <[email protected]>;
'[email protected]' <[email protected]>
Emne: Re: [Geoserver-users] Geoserver, App-Schema and Hale Studio
Hi,
Quick answer: you can achieve what you want with GeoServer App-Schema:
*
https://docs.geoserver.org/latest/en/user/data/app-schema/mapping-file.html#attributes-with-cardinality-1-n
*
https://docs.geoserver.org/latest/en/user/data/app-schema/feature-chaining.html#multi-valued-properties-by-reference-xlink-href
... but I don't think you can do it with HALE integration. I will double check
what is going on ... not sure when I will have time to do it.
Hope it helps,
Nuno Oliveira
On Tue, 2018-11-13 at 15:24 +0000, Jonas Nygaard Pedersen wrote:
Hi list,
I’m trying to do a transformation of two tables from Postgres (see below) to a
target XML schema
(http://inspire.ec.europa.eu/schemas/plu/4.0/PlannedLandUse.xsd).
Most of my data is in one table (plu_spatialplan) where the columns can be
directly renamed in an one-to-one relationship.
But I have a few targets in the XML schema (e.g. SpatialPlan.member.href) which
have a 0-to-many relationship. To handle this situation I create a join in hale
studio between my main table (plu_spatialplan) and the table
plu_zoningelement_member, which has the values that should be mapped to the
SpatialPlan.member.href target.
This all seems to work just fine in Hale Studio. And if I output the
transformed data as GML, everything again seems fine.
But when I export the alignment to Geoserver (as an Application Schema) via the
Direct Upload option, I get a new dialogue, which requires me to chain the two
tables (they are already joined in Hale Studio context).
In this dialogue the plu_spatialplan table has the CONTAINER role and the
plu_zoningelement_member table has the NESTED role, which seems right, as I
want each row in plu_spatialplan data to hold more than one element from
plu_zoningelement_member.
But when choosing the Target Type I do not have the option to choose
SpatialPlan.member.href as the Target Type. In fact I can’t choose anything but
SpatialPlan.ordinance.OrdinanceValue, which doesn’t seem to have any relation
at all to the join I’m performing.
So I’m stuck and would love to hear from anyone having experience mapping
INSPIRE data in Hale Studio, using two or more tables with a join and uploading
the alignment to Geoserver/Application-Schema
CREATE TABLE plu_spatialplan
(
gmlid character varying(4000),
inspireid_localid character varying(4000) NOT NULL,
inspireid_namespace character(61),
extent1 geometry,
officialtitle character varying(51),
levelofspatialplan character(69),
plantypename character(64),
beginlifespanversion timestamp(6) with time zone,
endlifespanversion character(17),
validfrom timestamp(0) without time zone,
validto character(17),
alternativetitle character varying(37),
processstepgeneral character(71),
backgroundmap character(17),
ordinancedate timestamp(0) without time zone,
ordinancereference character(16),
CONSTRAINT plu_spatialplan_pkey PRIMARY KEY (inspireid_localid)
)
CREATE TABLE plu_zoningelement_member
(
plan_inspireid_localid character(36),
member_href character varying(4000),
CONSTRAINT plu_zoningelement_member_plan_inspireid_localid_fkey FOREIGN KEY
(plan_inspireid_localid)
REFERENCES plu_spatialplan (inspireid_localid)
)
Regards,
Jonas
_______________________________________________
Geoserver-users mailing list
Please make sure you read the following two resources before posting to this
list:
- Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
If you want to request a feature or an improvement, also see this:
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
Regards,
Nuno Oliveira
==
GeoServer Professional Services from the
experts!
Visit http://goo.gl/it488V for more information.
==
Nuno Miguel Carvalho Oliveira
@nmcoliveira
Software Engineer
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
Con riferimento alla normativa sul trattamento dei dati
personali (Reg. UE 2016/679 - Regolamento generale sulla
protezione dei dati “GDPR”), si precisa che ogni
circostanza inerente alla presente email (il suo contenuto,
gli eventuali allegati, etc.) è un dato la cui conoscenza
è riservata al/i solo/i destinatario/i indicati dallo
scrivente. Se il messaggio Le è giunto per errore, è
tenuta/o a cancellarlo, ogni altra operazione è illecita.
Le sarei comunque grato se potesse darmene notizia.
This email is intended only for the person or entity to
which it is addressed and may contain information that
is privileged, confidential or otherwise protected from
disclosure. We remind that - as provided by European
Regulation 2016/679 “GDPR” - copying, dissemination or
use of this e-mail or the information herein by anyone
other than the intended recipient is prohibited. If you
have received this email by mistake, please notify
us immediately by telephone or e-mail.
_______________________________________________
Geoserver-users mailing list
Please make sure you read the following two resources before posting to this
list:
- Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
If you want to request a feature or an improvement, also see this:
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users