[mapguide-users] filter for features

Mauricio Villablanca mgvillablanca at yahoo.com
Mon Oct 20 16:20:57 EDT 2008


I had similar issues using PHP.Try changing the filter to:

$filter = '"FeatId" = ' . 112; //note the single then the double quote
queryOptions->SetFilter($filter);




Eva wrote:
> 
> 
> Hi,
> I am having problem with filter for features. 
> The code is working when I filter by “PROPADR” for the parcels layer, but
> when I use the filter with the property “FeatId”, the result is empty.  
> Here is the syntax I used for both cases:
> 
> MgFeatureQueryOptions queryOptions = new MgFeatureQueryOptions();
> queryOptions.SetFilter("FeatId = 112");
> 
> or 
> 
> MgFeatureQueryOptions queryOptions = new MgFeatureQueryOptions();
> queryOptions.SetFilter("PROPADR  LIKE 'DEININGER RD'");
> 
> I try to verify the Xml schema of the layer, but it seem that the “FeatId”
> is Int32 , and “PROPADR” is a string. 
> Is there some syntax problem in my code, or why the filter is not working
> in
> case “FeatId” ? 
> 
> I need to have unique identifier for the parcels, and it seems from the
> schema that “FeatId” is the key.
> Here is the part of Xml schema for the layer:
>    <xs:element name="parcels" type="Default:parcelsType" abstract="false"  
> substitutionGroup="gml:_Feature">
> -    <xs:key name="parcelsKey">
>         <xs:selector xpath=".//parcels" /> 
>         <xs:field xpath="FeatId" /> 
>   </xs:key>
>  </xs:element>
> - <xs:complexType name="parcelsType" abstract="false"
> fdo:geometryName="Geometry">
> -   <xs:complexContent>
> -      <xs:extension base="gml:AbstractFeatureType">
> -     <xs:sequence>
> -         <xs:element name="FeatId">
> -             <xs:simpleType>
>                  <xs:restriction base="fdo:int32" /> 
>               </xs:simpleType>
>          </xs:element>
>           <xs:element name="PROPADR" minOccurs="0">
> -             <xs:simpleType>
> -               <xs:restriction base="xs:string">
>                   <xs:maxLength value="40" /> 
>                </xs:restriction>
>             </xs:simpleType>
>          </xs:element>
> 
> -- 
> View this message in context:
> http://www.nabble.com/filter-for-features-tp19761808p19761808.html
> Sent from the MapGuide Users mailing list archive at Nabble.com.
> 
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> 
> 

-- 
View this message in context: http://n2.nabble.com/filter-for-features-tp1131530p1356973.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list