@@ -1355,7 +1355,8 @@ int msGMLWriteQuery(mapObj *map, char *filename, const char *namespaces)
1355
1355
** Similar to msGMLWriteQuery() but tuned for use with WFS
1356
1356
*/
1357
1357
int msGMLWriteWFSQuery (mapObj * map , FILE * stream , const char * default_namespace_prefix ,
1358
- OWSGMLVersion outputformat , int nWFSVersion , int bUseURN )
1358
+ OWSGMLVersion outputformat , int nWFSVersion , int bUseURN ,
1359
+ int bGetPropertyValueRequest )
1359
1360
{
1360
1361
#ifdef USE_WFS_SVR
1361
1362
int status ;
@@ -1381,7 +1382,8 @@ int msGMLWriteWFSQuery(mapObj *map, FILE *stream, const char *default_namespace_
1381
1382
bSwapAxis = msIsAxisInvertedProj (& (map -> projection ));
1382
1383
1383
1384
/* Need to start with BBOX of the whole resultset */
1384
- if (msGetQueryResultBounds (map , & resultBounds ) > 0 ) {
1385
+ if (!bGetPropertyValueRequest &&
1386
+ msGetQueryResultBounds (map , & resultBounds ) > 0 ) {
1385
1387
char * srs = NULL ;
1386
1388
if (bSwapAxis ) {
1387
1389
tmp = resultBounds .minx ;
@@ -1499,21 +1501,25 @@ int msGMLWriteWFSQuery(mapObj *map, FILE *stream, const char *default_namespace_
1499
1501
** start this feature
1500
1502
*/
1501
1503
if ( nWFSVersion == OWS_2_0_0 )
1502
- msIO_fprintf (stream , " <wfs:member>\n" );
1504
+ msIO_fprintf (stream , " <wfs:member>\n" );
1503
1505
else
1504
- msIO_fprintf (stream , " <gml:featureMember>\n" );
1506
+ msIO_fprintf (stream , " <gml:featureMember>\n" );
1505
1507
if (msIsXMLTagValid (layerName ) == MS_FALSE )
1506
- msIO_fprintf (stream , "<!-- WARNING: The value '%s' is not valid in a XML tag context. -->\n" , layerName );
1508
+ msIO_fprintf (stream , "<!-- WARNING: The value '%s' is not valid in a XML tag context. -->\n" , layerName );
1507
1509
if (featureIdIndex != -1 ) {
1508
- pszFID = (char * ) msSmallMalloc ( strlen (lp -> name ) + 1 + strlen (shape .values [featureIdIndex ]) + 1 );
1509
- sprintf (pszFID , "%s.%s" , lp -> name , shape .values [featureIdIndex ]);
1510
- if (outputformat == OWS_GML2 )
1511
- msIO_fprintf (stream , " <%s fid=\"%s\">\n" , layerName , pszFID );
1512
- else /* OWS_GML3 or OWS_GML32 */
1513
- msIO_fprintf (stream , " <%s gml:id=\"%s\">\n" , layerName , pszFID );
1510
+ pszFID = (char * ) msSmallMalloc ( strlen (lp -> name ) + 1 + strlen (shape .values [featureIdIndex ]) + 1 );
1511
+ sprintf (pszFID , "%s.%s" , lp -> name , shape .values [featureIdIndex ]);
1512
+ if ( !bGetPropertyValueRequest )
1513
+ {
1514
+ if (outputformat == OWS_GML2 )
1515
+ msIO_fprintf (stream , " <%s fid=\"%s\">\n" , layerName , pszFID );
1516
+ else /* OWS_GML3 or OWS_GML32 */
1517
+ msIO_fprintf (stream , " <%s gml:id=\"%s\">\n" , layerName , pszFID );
1518
+ }
1514
1519
} else {
1515
- pszFID = msStrdup ("" );
1516
- msIO_fprintf (stream , " <%s>\n" , layerName );
1520
+ pszFID = msStrdup ("" );
1521
+ if ( !bGetPropertyValueRequest )
1522
+ msIO_fprintf (stream , " <%s>\n" , layerName );
1517
1523
}
1518
1524
1519
1525
if (bSwapAxis )
@@ -1522,7 +1528,8 @@ int msGMLWriteWFSQuery(mapObj *map, FILE *stream, const char *default_namespace_
1522
1528
/* write the feature geometry and bounding box */
1523
1529
if (!(geometryList && geometryList -> numgeometries == 1 &&
1524
1530
strcasecmp (geometryList -> geometries [0 ].name , "none" ) == 0 )) {
1525
- gmlWriteBounds (stream , outputformat , & (shape .bounds ), srs , " " , "gml" );
1531
+ if ( !bGetPropertyValueRequest )
1532
+ gmlWriteBounds (stream , outputformat , & (shape .bounds ), srs , " " , "gml" );
1526
1533
gmlWriteGeometry (stream , geometryList , outputformat , & (shape ), srs , namespace_prefix , " " , pszFID );
1527
1534
}
1528
1535
@@ -1547,8 +1554,10 @@ int msGMLWriteWFSQuery(mapObj *map, FILE *stream, const char *default_namespace_
1547
1554
for (k = 0 ; k < groupList -> numgroups ; k ++ )
1548
1555
msGMLWriteGroup (stream , & (groupList -> groups [k ]), & shape , itemList , constantList , namespace_prefix , " " );
1549
1556
1550
- /* end this feature */
1551
- msIO_fprintf (stream , " </%s>\n" , layerName );
1557
+ if ( !bGetPropertyValueRequest )
1558
+ /* end this feature */
1559
+ msIO_fprintf (stream , " </%s>\n" , layerName );
1560
+
1552
1561
if ( nWFSVersion == OWS_2_0_0 )
1553
1562
msIO_fprintf (stream , " </wfs:member>\n" );
1554
1563
else
@@ -1575,7 +1584,7 @@ int msGMLWriteWFSQuery(mapObj *map, FILE *stream, const char *default_namespace_
1575
1584
return (MS_SUCCESS );
1576
1585
1577
1586
#else /* Stub for mapscript */
1578
- msSetError (MS_MISCERR , "WMS server support not enabled" , "msGMLWriteWFSQuery()" );
1587
+ msSetError (MS_MISCERR , "WFS server support not enabled" , "msGMLWriteWFSQuery()" );
1579
1588
return MS_FAILURE ;
1580
1589
#endif /* USE_WFS_SVR */
1581
1590
}
0 commit comments