Data missing with queryFeatures

312
0
08-18-2020 02:55 AM
kawishabbas
New Contributor III

Hi

I am going to show centroid points of the polygon as a textSymbol on the map but an issue that I am facing, the total features of the polygon are 69048 but 14570 centroid points are displaying on the map.

For better understanding, I have created the point symbol of centroids, as you can see in the attached image the centroid points of some polygons are not showing.

Anyone can help me?

Robert Scheitlin, GISPEgge-Jan Pollé

 let parcelSDE = new FeatureLayer({
                    url: "Service URL",
                    title: "Parcel",
                    labelsVisible: true,
                    legendEnabled: true,
                })
 map.add(parcelSDE)

var parcel = parcelSDE.createQuery();
parcel.where = "1=1"
parcelSDE.queryFeatures(parcel).then(function (response) {
    response.features.map((e, i) => {
        console.log(i)
        //69048 features

        var points = {
            type: "point",
            x: e.geometry.centroid.x,
            y: e.geometry.centroid.y,
            spatialReference: { wkid: 32642 }
        };
    
        var textSymbol = {
            type: "text",
            color: "black",
            haloColor: "white",
            text: e.attributes.house_no,
            haloSize: 1,
            font: {
                family: "Arial",
                size: 6,
                weight: "bold"
            }
        };

        /*  let symbol = {
            type: "simple-marker",
            size: 5,
            color: [0, 255, 255],
            outline: null
        } */

        var pointGraphic = new Graphic({
            geometry: points,
            symbol: textSymbol
        });
        
        console.log(pointGraphic)
        // 14570 centroid points
        view.graphics.add(pointGraphic)
 

    })
})‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
0 Kudos
0 Replies