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

Brent Fraser bfraser at geoanalytic.com
Fri Jan 6 13:31:17 PST 2023


If you want to pursue the joined table approach, I did some searching of my archived projects and found this method of doing a join in the DATA object (with some commented out experiments):

CONNECTIONTYPE OGR
CONNECTION     'T:/GeoData/Parcels/Alberta/t_505033.shp'
DATA "SELECT * FROM t_505033 LEFT JOIN 'ODBC:Parcels_Rural,basic'.basic ON t_505033.PID=basic.PID"
##    DATA "SELECT * FROM (t_505033 LEFT JOIN 'ODBC:Parcels_Rural'.basic  ON t_505033.PID=basic.PID) LEFT JOIN 'ODBC:Parcels_Rural'.estate ON basic.LINC=estate.LINC"
##    DATA 'SELECT * FROM t_505033 LEFT JOIN "ODBC:Driver={Microsoft Access Driver (*.mdb)};Dbq=G\GeoData\Parcels\Alberta\t_505033.mdb".basic ON t_505033.PID=basic.PID'

I used the ODBC driver because the other table was in an MS Access .mdb.  You may need to do some experimenting to get the syntax for joining a shp file to a dbf.

Brent

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

Thanks for the suggestion! I hadn't thought of approaching it that way.

Chris

--
Chris Hughes

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

----------------------------------------
From: GeoMoose-users <geomoose-users-bounces at lists.osgeo.org> on behalf of Brent Fraser <bfraser at geoanalytic.com>
Sent: Friday, January 6, 2023 8:32 AM
To: GeoMoose Users <geomoose-users at lists.osgeo.org>
Subject:Re: [GeoMoose-users] One to Many Join - GeoMoose 3 

Chris,

It's an interesting problem.  Depending on how you want the user access and visualize the data, where could be other solutions.  One solution would be to would be to write a server-side script (in Python, PHP, etc) to take an ID parameter and return an HTML page of records of the join table.  You could put a link in each of  the GeoMoose result rows to reference the script, something like

https://myserver/getBuildings.php?parcel_id=2102
https://myserver/getBuildings.php?parcel_id=4037

Clicking on one of these would bring a list of "joined" records in a new page or popup.

Brent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geomoose-users/attachments/20230106/14712ad2/attachment-0001.htm>


More information about the GeoMoose-users mailing list