[MS4W-Users] Query and Write to File Geodatabase?

igis at interactivegis.com igis at interactivegis.com
Thu May 23 08:57:34 EDT 2019

We have an ESRI File Geodatabase (OpenFileGDB) folder/database and are 
trying to work with it using MS4W and SWIG MapScript PHP.  It's working 
well to create maps and get data and query by shape and point, but I've 
been asked to look into a couple other things and I'm not having much 
luck, and would appreciate any clarification or pointers in the right 

1) We'd like to be able to use PHP to get data from specific GDB tables. 
  For example, with a restaurant table with a street_name column in the 
attribute table, we'd like to be able to query and produce a report 
saying Main St has 8 and Elm has 2, etc.  In a SQL based database it's 
like "SELECT DISTINCT street_name, COUNT(street_name) FROM restaurant 
GROUP BY street_name;" and you get results rather quickly.  However, 
I've only been able to compile this information by looping through all 
the records in the table and adding it to a PHP array which is slow and 
inefficient.  Is there a better way to do this that I'm missing?

2) In the near future, we'd like to be also write drawn lines or shapes 
to a table in the GDB over the web using PHP.  Is this even possible?  
At https://mapserver.org/input/vector/filegdb.html the sample "ogrinfo 
--formats" lists FileGDB as read/write but 
https://www.gdal.org/drv_openfilegdb.html says the GDAL OpenFileGDB 
driver is read-only.  Furthermore, when I run "ogrinfo --formats" from 
C:\ms4w\tools\gdal-ogr\  I get an error that "The code execution cannot 
proceed because gdal204.dll was not found. Reinstalling the program may 
fix this problem." so I'm not sure how to proceed, or if I'm even on the 
right path.

Thanks for any comments, clarification, or pointers!

PS > It appears the link on 
https://mapserver.org/input/vector/filegdb.html to OGR driver page needs 
to be updated from https://www.gdal.org/ogr/drv_filegdb.html (404) to I 
believe https://www.gdal.org/drv_openfilegdb.html.  This looks like it 
may affect a lot of links to GDAL.org for the databases on 
https://mapserver.org/input/ if anyone here has access and time to 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ms4w.com/pipermail/ms4w-users/attachments/20190523/e1db34fd/attachment.html>

More information about the MS4W-Users mailing list