[GeoMoose-users] One to Many Join - GeoMoose 3

Christopher Hughes chughes at co.lincoln.or.us
Fri Jan 6 08:14:25 PST 2023


The main reason I was looking at the mapserver join was because there were pretty good examples of how to return html results for a one-to-many join. Checked apache logs, auto identify results, and DEBUG 5 and didn't get anything that would indicate the joined table was being included.

Just wanted to make sure there wasn't something I was missing, like config options in the mapbook.

Thanks!


--
Chris Hughes

GIS Analyst
Lincoln County GIS Department
880 NE 7th St. l Newport, OR 97365
Tel: (541) 574 1283

________________________________
From: James Klassen <klassen.js at gmail.com>
Sent: Friday, January 6, 2023 12:46 AM
To: bfraser at geoanalytic.com <bfraser at geoanalytic.com>
Cc: Christopher Hughes <chughes at co.lincoln.or.us>; geomoose-users-osgeo <geomoose-users at lists.osgeo.org>
Subject: Re: [GeoMoose-users] One to Many Join - GeoMoose 3

Personally, I haven’t used MapServer JOIN in a very long time and instead, as Brent suggested, prefer using doing joins in SQL (OGR’s SQL capabilities, PostGIS or GPKG).

One thought is I’m not sure MapServer JOIN would work over WFS.  My impression is it is meant more for use with MapServer templates (mode=query, mode=nquery) which GeoMoose no longer uses (as of ver 3).  The interesting bit here is the MapServer join one-to-many join doesn’t appear to duplicate the feature like a SQL join ahead of MapServer would generally do (unless some SQL tricks are done to transform the multiple joined rows into columns.  I’m not sure how MapServer/GeoMoose would handle an array column or a json column.)

And besides auto=true, looking at the WFS response GML with the browser debugger can be helpful too (or looking at the WFS in QGIS).  My guess is the JOINed columns aren’t in the WFS response.

On Thu, Jan 5, 2023 at 18:59 Brent Fraser <bfraser at geoanalytic.com<mailto:bfraser at geoanalytic.com>> wrote:
I've done a join in the DATA statement and in an ogr vrt file, but I don't recall using the JOIN object in the map file.  Likely you need to be careful to use upper case for the DBF column names. GeoMoose 3 uses WMS/WFS to communicate with Mapserver; maybe the JOIN doesn't work with these protocols.

Did you set DEBUG 5 and check the contents of the log file?



________________________________
From: "Christopher Hughes" <chughes at co.lincoln.or.us<mailto:chughes at co.lincoln.or.us>>
Sent: 1/5/23 5:32 PM
To: geomoose-users-osgeo <geomoose-users at lists.osgeo.org<mailto:geomoose-users at lists.osgeo.org>>, "bfraser at geoanalytic.com<mailto:bfraser at geoanalytic.com>" <bfraser at geoanalytic.com<mailto:bfraser at geoanalytic.com>>
Subject: Re: [GeoMoose-users] One to Many Join - GeoMoose 3

In this case my join is one-to-many. For each parcel I have multiple results in the table I'm trying to join. The issue is that I only get results for the initial layer, not for the table I'm trying to join to the initial layer. I've tried auto="true", which works except it only gives me the values for the parcel layer, not the table I'm trying to join in the mapfile. I wasn't sure if there was a way of setting the join parameters in the mapbook map-source rather than in mapfile layer.

--
Chris Hughes

GIS Analyst
Lincoln County GIS Department
880 NE 7th<https://www.google.com/maps/search/880+NE+7th?entry=gmail&source=g> St. l Newport, OR 97365
Tel: (541) 574 1283


________________________________
From: Brent Fraser <bfraser at geoanalytic.com<mailto:bfraser at geoanalytic.com>>
Sent: Thursday, January 5, 2023 4:06 PM
To: Christopher Hughes <chughes at co.lincoln.or.us<mailto:chughes at co.lincoln.or.us>>; geomoose-users-osgeo <geomoose-users at lists.osgeo.org<mailto:geomoose-users at lists.osgeo.org>>
Subject:RE: [GeoMoose-users] One to Many Join - GeoMoose 3

Hi Chris,

  Usually what I do is in the mapbook set   <template name="identify" auto="true" /> and do an Identify on a parcel to what Mapserver sends back via GML format.  You can then tune your GeoMoose template using the property names shown in the Identify results.

Should your join be a one-to-one?  Have a look in the mapserver error log to see if there any problems on the Mapserver side.

Best Regards,
Brent Fraser



________________________________
From: "Christopher Hughes" <chughes at co.lincoln.or.us<mailto:chughes at co.lincoln.or.us>>
 Sent: 1/5/23 4:27 PM
 To: geomoose-users-osgeo <geomoose-users at lists.osgeo.org<mailto:geomoose-users at lists.osgeo.org>>
 Subject: [GeoMoose-users] One to Many Join - GeoMoose 3

Hello all,

I was curious if anyone's tried to do a join (in my case one-to-many) in GeoMoose 3.

I have a shapefile of parcels that I was trying to join to a dbf of related information for each parcel.
I was following the mapserver documentation for joins  Here<https://mapserver.org/mapfile/join.html> but I couldn't figure out how to convert the mapserver format where the templates and joins are specified in the mapfile to the GeoMoose 3 format where the templates are set in the mapbook.xml. I couldn't get results to reflect the JOIN parameters that were set in the mapfile.

Any feedback would be appreciated,

Chris


--
Chris Hughes

GIS Analyst
Lincoln County GIS Department
880 NE 7th<https://www.google.com/maps/search/880+NE+7th?entry=gmail&source=g> St. l Newport, OR 97365
Tel: (541) 574 1283

_______________________________________________
GeoMoose-users mailing list
GeoMoose-users at lists.osgeo.org<mailto:GeoMoose-users at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/geomoose-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geomoose-users/attachments/20230106/6f41838b/attachment-0001.htm>


More information about the GeoMoose-users mailing list