[Geoserver-users] Geoserver ResourceId (rid) filter

Good morning,
Im running into an issue with ArcGIS Pro trying to retrieve WFS data through http post method. The program is trying to request data from our geoserver instance with a filter on rid:

fes:Filter
<fes:ResourceId rid=“{layer}.0”/>
</fes:Filter>

I see in the OGC 2.0 specifications that the server should specify a resource id for every feature.

Am I supposed to add this field myself? Is geoserver supposed to do it automatically? We are running 2.18.2. Is this fixed in layer versions?

Any guidance would be greatly appreciated. Thanks!

···

Arjun Dongre

Western EcoSystems Technology, Inc.
Environmental & Statistical Consultants

415 W. 17th St. Suite 200
Cheyenne, WY 82001

adongre@anonymised.com
www.west-inc.com

Follow WEST: Facebook, Twitter, Linked In, Join our Mailing list

CONFIDENTIALITY NOTICE: This message and any accompanying communications are covered by the Electronic Communications Privacy Act, 18 U.S.C. §§ 2510-2521, and contain information that is privileged, confidential or otherwise protected from disclosure. If you are not the intended recipient or an agent responsible for delivering the communication to the intended recipient, you are hereby notified that you have received this communication in error. Dissemination, distribution or copying of this e-mail or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the original message. Thank you.

P Please consider the environment before printing.

Hi,

Geoserver will generate a distinct ID for all features for you if you don’t specify the field to use as ID while using a sql view as source.

If you don’t specify it, Geoserver will generate an ID of this format : layerName.uid (ex: LayerName.fid-1e25e6bb_17b7379da69_-720a)

If you specify a field to represent the unique ID then the value of this field will be bound to each feature in this format : layerName.fieldValue (ex: layerName.1)

Hope this helps.

Good luck

···

Envoyé à partir d’Outlook


De : Arjun Dongre via Geoserver-users geoserver-users@lists.sourceforge.net
Envoyé : 25 août 2021 08:37
À : geoserver-users@lists.sourceforge.net geoserver-users@anonymised.coms.sourceforge.net
Objet : [Geoserver-users] Geoserver ResourceId (rid) filter

Good morning,
Im running into an issue with ArcGIS Pro trying to retrieve WFS data through http post method. The program is trying to request data from our geoserver instance with a filter on rid:

fes:Filter
<fes:ResourceId rid=“{layer}.0”/>
</fes:Filter>

I see in the OGC 2.0 specifications that the server should specify a resource id for every feature.

Am I supposed to add this field myself? Is geoserver supposed to do it automatically? We are running 2.18.2. Is this fixed in layer versions?

Any guidance would be greatly appreciated. Thanks!

Arjun Dongre

Western EcoSystems Technology, Inc.
Environmental & Statistical Consultants

415 W. 17th St. Suite 200
Cheyenne, WY 82001

adongre@anonymised.com047…
www.west-inc.com

Follow WEST: Facebook, Twitter, Linked In, Join our Mailing list

CONFIDENTIALITY NOTICE: This message and any accompanying communications are covered by the Electronic Communications Privacy Act, 18 U.S.C. §§ 2510-2521, and contain information that is privileged, confidential or otherwise protected from disclosure. If you are not the intended recipient or an agent responsible for delivering the communication to the intended recipient, you are hereby notified that you have received this communication in error. Dissemination, distribution or copying of this e-mail or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the original message. Thank you.

P Please consider the environment before printing.

This is exactly what is happening, how do I specify the unique id field?

···

Arjun Dongre

Western EcoSystems Technology, Inc.
Environmental & Statistical Consultants

415 W. 17th St. Suite 200
Cheyenne, WY 82001

adongre@anonymised.com
www.west-inc.com

Follow WEST: Facebook, Twitter, Linked In, Join our Mailing list

CONFIDENTIALITY NOTICE: This message and any accompanying communications are covered by the Electronic Communications Privacy Act, 18 U.S.C. §§ 2510-2521, and contain information that is privileged, confidential or otherwise protected from disclosure. If you are not the intended recipient or an agent responsible for delivering the communication to the intended recipient, you are hereby notified that you have received this communication in error. Dissemination, distribution or copying of this e-mail or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the original message. Thank you.

P Please consider the environment before printing.

Sorry, to specify, we are publishing a view from postgis. I don’t think you can set a “primary key” in a postgres view. I was assuming you could select the field in the geoserver layer settings.

···

Arjun Dongre

Western EcoSystems Technology, Inc.
Environmental & Statistical Consultants

415 W. 17th St. Suite 200
Cheyenne, WY 82001

adongre@anonymised.com
www.west-inc.com

Follow WEST: Facebook, Twitter, Linked In, Join our Mailing list

CONFIDENTIALITY NOTICE: This message and any accompanying communications are covered by the Electronic Communications Privacy Act, 18 U.S.C. §§ 2510-2521, and contain information that is privileged, confidential or otherwise protected from disclosure. If you are not the intended recipient or an agent responsible for delivering the communication to the intended recipient, you are hereby notified that you have received this communication in error. Dissemination, distribution or copying of this e-mail or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the original message. Thank you.

P Please consider the environment before printing.

Hi,

Instead of publishing a feature type directly from the store, use a sql view.

That way you can specify the ID column by selecting the column name as Identifier. You’ll be able to rename fields using sql AS keyword, perform joins, etc … All the power of SQL.

Have a look at this : https://docs.geoserver.org/master/en/user/data/database/sqlview.html

Good luck !

···

Envoyé à partir d’Outlook


De : Arjun Dongre via Geoserver-users geoserver-users@lists.sourceforge.net
Envoyé : 25 août 2021 10:27
À : geoserver-users@lists.sourceforge.net geoserver-users@anonymised.coms.sourceforge.net
Objet : Re: [Geoserver-users] Geoserver ResourceId (rid) filter

Sorry, to specify, we are publishing a view from postgis. I don’t think you can set a “primary key” in a postgres view. I was assuming you could select the field in the geoserver layer settings.

On Wed, Aug 25, 2021 at 10:23 AM Arjun Dongre <adongre@anonymised.com> wrote:

This is exactly what is happening, how do I specify the unique id field?

On Wed, Aug 25, 2021 at 10:07 AM Olivier Gagnon <mcnolii@anonymised.com> wrote:

Hi,

Geoserver will generate a distinct ID for all features for you if you don’t specify the field to use as ID while using a sql view as source.

If you don’t specify it, Geoserver will generate an ID of this format : layerName.uid (ex: LayerName.fid-1e25e6bb_17b7379da69_-720a)

If you specify a field to represent the unique ID then the value of this field will be bound to each feature in this format : layerName.fieldValue (ex: layerName.1)

Hope this helps.

Good luck

Envoyé à partir d’Outlook

De : Arjun Dongre via Geoserver-users <geoserver-users@anonymised.com.sourceforge.net>
Envoyé : 25 août 2021 08:37
À : geoserver-users@lists.sourceforge.net <geoserver-users@anonymised.comorge.net>
Objet : [Geoserver-users] Geoserver ResourceId (rid) filter

Good morning,
Im running into an issue with ArcGIS Pro trying to retrieve WFS data through http post method. The program is trying to request data from our geoserver instance with a filter on rid:

fes:Filter
<fes:ResourceId rid=“{layer}.0”/>
</fes:Filter>

I see in the OGC 2.0 specifications that the server should specify a resource id for every feature.

Am I supposed to add this field myself? Is geoserver supposed to do it automatically? We are running 2.18.2. Is this fixed in layer versions?

Any guidance would be greatly appreciated. Thanks!

Arjun Dongre

Western EcoSystems Technology, Inc.
Environmental & Statistical Consultants

415 W. 17th St. Suite 200
Cheyenne, WY 82001

adongre@anonymised.com047…
www.west-inc.com

Follow WEST: Facebook, Twitter, Linked In, Join our Mailing list

CONFIDENTIALITY NOTICE: This message and any accompanying communications are covered by the Electronic Communications Privacy Act, 18 U.S.C. §§ 2510-2521, and contain information that is privileged, confidential or otherwise protected from disclosure. If you are not the intended recipient or an agent responsible for delivering the communication to the intended recipient, you are hereby notified that you have received this communication in error. Dissemination, distribution or copying of this e-mail or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the original message. Thank you.

P Please consider the environment before printing.

Arjun Dongre

Western EcoSystems Technology, Inc.
Environmental & Statistical Consultants

415 W. 17th St. Suite 200
Cheyenne, WY 82001

adongre@anonymised.com047…
www.west-inc.com

Follow WEST: Facebook, Twitter, Linked In, Join our Mailing list

CONFIDENTIALITY NOTICE: This message and any accompanying communications are covered by the Electronic Communications Privacy Act, 18 U.S.C. §§ 2510-2521, and contain information that is privileged, confidential or otherwise protected from disclosure. If you are not the intended recipient or an agent responsible for delivering the communication to the intended recipient, you are hereby notified that you have received this communication in error. Dissemination, distribution or copying of this e-mail or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the original message. Thank you.

P Please consider the environment before printing.

Arjun Dongre

Western EcoSystems Technology, Inc.
Environmental & Statistical Consultants

415 W. 17th St. Suite 200
Cheyenne, WY 82001

adongre@anonymised.com047…
www.west-inc.com

Follow WEST: Facebook, Twitter, Linked In, Join our Mailing list

CONFIDENTIALITY NOTICE: This message and any accompanying communications are covered by the Electronic Communications Privacy Act, 18 U.S.C. §§ 2510-2521, and contain information that is privileged, confidential or otherwise protected from disclosure. If you are not the intended recipient or an agent responsible for delivering the communication to the intended recipient, you are hereby notified that you have received this communication in error. Dissemination, distribution or copying of this e-mail or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the original message. Thank you.

P Please consider the environment before printing.


If you leave the filter out it will request all features.

The filter forms an expression, so you can select all the content meeting a specific conduction. The ResourceId or FeatureId is a specific expression where you are selecting a single feature.

Perhaps you are selecting a feature in your desktop GIS and it is attempting to select the values for a single feature?

I am a bit confused by {layer} in your example as that appears to be a mistake? Try requesting the features using the geoserver layer preview in order to see some examples of valid feature ids for your service.

Jody

···


Jody Garnett

Please remember to include the user list in communication, if you are unable to participate in public (some folks have restrictions) there are a number of commercial providers offering support (including my employer GeoCat).

GeoServer speaks several protocols:

  • WMS for web map services which is what you selected for JPEG (ie an image)
  • WFS for web feature service (please select GML or JSON to see an example)

You want to select a WFS service in order see some feature content and determine the correct patter for feature id or resource id.

Jody

image.png

image.png

···


Jody Garnett

The response from Arjun …

···

Envoyé à partir d’Outlook


De : Arjun Dongre adongre@anonymised.com
Envoyé : 25 août 2021 11:17
Objet : Re: [Geoserver-users] Geoserver ResourceId (rid) filter

Thank you so much. I copied the view statement from postgres to geoserver, set the identifier. And the problem was resolved in arcpro. Thank you so much!

On Wed, Aug 25, 2021 at 10:57 AM Olivier Gagnon <mcnolii@anonymised.com> wrote:

Hi,

Instead of publishing a feature type directly from the store, use a sql view.

That way you can specify the ID column by selecting the column name as Identifier. You’ll be able to rename fields using sql AS keyword, perform joins, etc … All the power of SQL.

Have a look at this : https://docs.geoserver.org/master/en/user/data/database/sqlview.html

Good luck !

Envoyé à partir d’Outlook

De : Arjun Dongre via Geoserver-users <geoserver-users@anonymised.comrge.net>
Envoyé : 25 août 2021 10:27
À : geoserver-users@lists.sourceforge.net <geoserver-users@anonymised.comorge.net>
Objet : Re: [Geoserver-users] Geoserver ResourceId (rid) filter

Sorry, to specify, we are publishing a view from postgis. I don’t think you can set a “primary key” in a postgres view. I was assuming you could select the field in the geoserver layer settings.

On Wed, Aug 25, 2021 at 10:23 AM Arjun Dongre <adongre@anonymised.com> wrote:

This is exactly what is happening, how do I specify the unique id field?

On Wed, Aug 25, 2021 at 10:07 AM Olivier Gagnon <mcnolii@anonymised.com> wrote:

Hi,

Geoserver will generate a distinct ID for all features for you if you don’t specify the field to use as ID while using a sql view as source.

If you don’t specify it, Geoserver will generate an ID of this format : layerName.uid (ex: LayerName.fid-1e25e6bb_17b7379da69_-720a)

If you specify a field to represent the unique ID then the value of this field will be bound to each feature in this format : layerName.fieldValue (ex: layerName.1)

Hope this helps.

Good luck

Envoyé à partir d’Outlook

De : Arjun Dongre via Geoserver-users <geoserver-users@anonymised.com.sourceforge.net>
Envoyé : 25 août 2021 08:37
À : geoserver-users@lists.sourceforge.net <geoserver-users@anonymised.comorge.net>
Objet : [Geoserver-users] Geoserver ResourceId (rid) filter

Good morning,
Im running into an issue with ArcGIS Pro trying to retrieve WFS data through http post method. The program is trying to request data from our geoserver instance with a filter on rid:

fes:Filter
<fes:ResourceId rid=“{layer}.0”/>
</fes:Filter>

I see in the OGC 2.0 specifications that the server should specify a resource id for every feature.

Am I supposed to add this field myself? Is geoserver supposed to do it automatically? We are running 2.18.2. Is this fixed in layer versions?

Any guidance would be greatly appreciated. Thanks!

Arjun Dongre

Western EcoSystems Technology, Inc.
Environmental & Statistical Consultants

415 W. 17th St. Suite 200
Cheyenne, WY 82001

adongre@anonymised.com047…
www.west-inc.com

Follow WEST: Facebook, Twitter, Linked In, Join our Mailing list

CONFIDENTIALITY NOTICE: This message and any accompanying communications are covered by the Electronic Communications Privacy Act, 18 U.S.C. §§ 2510-2521, and contain information that is privileged, confidential or otherwise protected from disclosure. If you are not the intended recipient or an agent responsible for delivering the communication to the intended recipient, you are hereby notified that you have received this communication in error. Dissemination, distribution or copying of this e-mail or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the original message. Thank you.

P Please consider the environment before printing.

Arjun Dongre

Western EcoSystems Technology, Inc.
Environmental & Statistical Consultants

415 W. 17th St. Suite 200
Cheyenne, WY 82001

adongre@anonymised.com047…
www.west-inc.com

Follow WEST: Facebook, Twitter, Linked In, Join our Mailing list

CONFIDENTIALITY NOTICE: This message and any accompanying communications are covered by the Electronic Communications Privacy Act, 18 U.S.C. §§ 2510-2521, and contain information that is privileged, confidential or otherwise protected from disclosure. If you are not the intended recipient or an agent responsible for delivering the communication to the intended recipient, you are hereby notified that you have received this communication in error. Dissemination, distribution or copying of this e-mail or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the original message. Thank you.

P Please consider the environment before printing.

Arjun Dongre

Western EcoSystems Technology, Inc.
Environmental & Statistical Consultants

415 W. 17th St. Suite 200
Cheyenne, WY 82001

adongre@anonymised.com047…
www.west-inc.com

Follow WEST: Facebook, Twitter, Linked In, Join our Mailing list

CONFIDENTIALITY NOTICE: This message and any accompanying communications are covered by the Electronic Communications Privacy Act, 18 U.S.C. §§ 2510-2521, and contain information that is privileged, confidential or otherwise protected from disclosure. If you are not the intended recipient or an agent responsible for delivering the communication to the intended recipient, you are hereby notified that you have received this communication in error. Dissemination, distribution or copying of this e-mail or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the original message. Thank you.

P Please consider the environment before printing.

Arjun Dongre

Western EcoSystems Technology, Inc.
Environmental & Statistical Consultants

415 W. 17th St. Suite 200
Cheyenne, WY 82001

adongre@anonymised.com047…
www.west-inc.com

Follow WEST: Facebook, Twitter, Linked In, Join our Mailing list

CONFIDENTIALITY NOTICE: This message and any accompanying communications are covered by the Electronic Communications Privacy Act, 18 U.S.C. §§ 2510-2521, and contain information that is privileged, confidential or otherwise protected from disclosure. If you are not the intended recipient or an agent responsible for delivering the communication to the intended recipient, you are hereby notified that you have received this communication in error. Dissemination, distribution or copying of this e-mail or the information herein by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the original message. Thank you.

P Please consider the environment before printing.