Advertisement
blammo

Mapserver zoom to image in single pass

Jul 13th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.29 KB | None | 0 0
  1. Working on this, but not quite there yet . . .
  2.  
  3. My initial request looks like:
  4.  
  5. http://gis.ci.stpaul.mn.us/datasets/PUBLIC/LAND_OWNERSHIP/PARCELS/rc_parcels_assessment.map?
  6. mode=itemquery&
  7. qlayer=Parcels-Map-Query&
  8. qitem=parcelid&qstring=162823340026&
  9. WIDTH=1069&HEIGHT=917
  10.  
  11. I get a “no matching records” found . . . and with DEBUG 5 on the query layer . . .
  12.  
  13. CONNECTIONTYPE PostGIS
  14. CONNECTION “host=localhost dbname=postgres user=mapserv password=****”
  15.  
  16. DATA "wkb_geometry from (
  17. select objectid, parcelid, wkb_geometry from cache.rc_parcel_poly where parcelid = '%pin%' or parcelid = '%qstring%') as subquery using unique objectid srid=200068"
  18.  
  19. VALIDATION
  20. 'pin' '^[0-9]{12}$'
  21. 'qstring' '^[0-9]{12}$'
  22. END
  23.  
  24.  
  25. [Thu Jul 13 09:30:00 2017].645602 msPostGISGetPaging called.
  26. [Thu Jul 13 09:30:00 2017].645665 msPostGISLayerIsOpen called.
  27. [Thu Jul 13 09:30:00 2017].645672 msPostGISLayerFreeItemInfo called.
  28. [Thu Jul 13 09:30:00 2017].645675 msPostGISLayerClose called: wkb_geometry from (
  29. select objectid, parcelid, wkb_geometry from cache.rc_parcel_poly where parcelid = '%pin%' or parcelid = '162823340026') as subquery using unique objectid srid=200068
  30. [Thu Jul 13 09:30:00 2017].645680 msPostGISLayerOpen called: wkb_geometry from (
  31. select objectid, parcelid, wkb_geometry from cache.rc_parcel_poly where parcelid = '%pin%' or parcelid = '162823340026') as subquery using unique objectid srid=200068
  32. [Thu Jul 13 09:30:00 2017].645686 msPostGISLayerOpen: No connection in pool, creating a fresh one.
  33. [Thu Jul 13 09:30:00 2017].654626 msConnPoolRegister(Parcels-Map-Query,host=localhost dbname=postgres user=mapserv password=****,0x191b510)
  34. [Thu Jul 13 09:30:00 2017].659333 msPostGISLayerOpen: Got PostGIS version 20200.
  35. [Thu Jul 13 09:30:00 2017].659343 msPostGISLayerOpen: Forcing 2D geometries: yes.
  36. [Thu Jul 13 09:30:00 2017].659347 msPostGISEnablePaging called.
  37. [Thu Jul 13 09:30:00 2017].659349 msPostGISLayerIsOpen called.
  38. [Thu Jul 13 09:30:00 2017].659354 msPostGISLayerFreeItemInfo called.
  39. [Thu Jul 13 09:30:00 2017].659359 msPostGISLayerFreeItemInfo called.
  40. [Thu Jul 13 09:30:00 2017].659364 msPostGISLayerGetItems called.
  41. [Thu Jul 13 09:30:00 2017].659368 msPostGISParseData called.
  42. [Thu Jul 13 09:30:00 2017].659378 msPostGISParseData: unique_column=objectid, srid=, geom_column_name=wkb_geometry, table_name=(
  43. select objectid, parcelid, wkb_geometry from cache.rc_parcel_poly where parcelid = '%pin%' or parcelid = '162823340026') as subquery
  44. [Thu Jul 13 09:30:00 2017].659384 msPostGISLayerGetItems executing SQL: select * from (
  45. select objectid, parcelid, wkb_geometry from cache.rc_parcel_poly where parcelid = '%pin%' or parcelid = '162823340026') as subquery where false limit 0
  46. [Thu Jul 13 09:30:00 2017].666373 msPostGISLayerInitItemInfo called.
  47. [Thu Jul 13 09:30:00 2017].666385 msPostGISLayerInitItemInfo called.
  48. [Thu Jul 13 09:30:00 2017].666397 msPostGISLayerIsOpen called.
  49. [Thu Jul 13 09:30:00 2017].666403 msPostGISLayerWhichShapes called.
  50. [Thu Jul 13 09:30:00 2017].666406 msPostGISParseData called.
  51. [Thu Jul 13 09:30:00 2017].666413 msPostGISParseData: unique_column=objectid, srid=, geom_column_name=wkb_geometry, table_name=(
  52. select objectid, parcelid, wkb_geometry from cache.rc_parcel_poly where parcelid = '%pin%' or parcelid = '162823340026') as subquery
  53. [Thu Jul 13 09:30:00 2017].666417 msPostGISBuildSQL called.
  54. [Thu Jul 13 09:30:00 2017].666419 msPostGISBuildSQLItems called.
  55. [Thu Jul 13 09:30:00 2017].666422 msPostGISBuildSQLItems: 2 items requested.
  56. [Thu Jul 13 09:30:00 2017].666426 msPostGISBuildSQLFrom called.
  57. [Thu Jul 13 09:30:00 2017].666429 msPostGISBuildSQLWhere called.
  58. [Thu Jul 13 09:30:00 2017].666432 msPostGISBuildSQLSRID called.
  59. [Thu Jul 13 09:30:00 2017].666435 msPostGISBuildSQLSRID: Building find_srid line.
  60. [Thu Jul 13 09:30:00 2017].666438 msPostGISBuildSQLBox called.
  61. [Thu Jul 13 09:30:00 2017].666459 msPostGISLayerWhichShapes query: select "objectid","parcelid",encode(ST_AsBinary(ST_Force2D("wkb_geometry"),'NDR'),'hex') as geom,"objectid" from (
  62. select objectid, parcelid, wkb_geometry from cache.rc_parcel_poly where parcelid = '%pin%' or parcelid = '162823340026') as subquery where wkb_geometry && ST_GeomFromText('POLYGON((573387 162092,573387 162555,574211 162555,574211 162092,573387 162092))',find_srid('','cache.rc_parcel_poly','wkb_geometry')) and ("parcelid"::text = '162823340026')
  63. [Thu Jul 13 09:30:01 2017].114391 msPostGISLayerWhichShapes query status: PGRES_TUPLES_OK (2)
  64. [Thu Jul 13 09:30:01 2017].114407 msPostGISLayerWhichShapes got 0 records in result.
  65. [Thu Jul 13 09:30:01 2017].114412 msPostGISLayerNextShape called.
  66. [Thu Jul 13 09:30:01 2017].114416 msPostGISLayerFreeItemInfo called.
  67. [Thu Jul 13 09:30:01 2017].114419 msPostGISLayerClose called: wkb_geometry from (
  68. select objectid, parcelid, wkb_geometry from cache.rc_parcel_poly where parcelid = '%pin%' or parcelid = '162823340026') as subquery using unique objectid srid=200068
  69. [Thu Jul 13 09:30:01 2017].114443 msConnPoolRelease(Parcels-Map-Query,host=localhost dbname=postgres user=mapserv password=****,0x191b510)
  70. [Thu Jul 13 09:30:01 2017].114447 msConnPoolClose(host=localhost dbname=postgres user=mapserv password=****,0x191b510)
  71. [Thu Jul 13 09:30:01 2017].114546 msQueryByFilter(): Search returned no results. No matching record(s) found.
  72. [Thu Jul 13 09:30:01 2017].114657 freeLayer(): freeing layer at 0x18e8a40.
  73. [Thu Jul 13 09:30:01 2017].114661 msPostGISLayerIsOpen called.
  74.  
  75. The subquery works fine from sql and returns a single record. One thing I noticed, is that the POLYGON BBOX is way off to the west a few thousand feet. There is no default image size in the Mapfile either so I don’t know where that number is coming from other than shpext . . . are there other parameters that need to be added to the shpext call?
  76.  
  77. the TEMPLATE link looks like:
  78.  
  79. TEMPLATE 'http://gis.ci.stpaul.mn.us/datasets/PUBLIC/LAND_OWNERSHIP/PARCELS/rc_parcels_assessment.map?pin=162823340026&FORMAT=image%2Fpng&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&LAYERS=all&_OLSALT=0.7873164216111053&SRS=EPSG%3A200068&BBOX=[shpext format="$minx,$miny,$maxx,$maxy"]&WIDTH=1069&HEIGHT=917'
  80.  
  81. This will (should) return an image, should it be some sort of text return instead? I’m trying to keep it WMS too . . . is this still doable??
  82.  
  83. bobb
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement