Exemplo n.º 1
0
        public List <double> getGeometryLineString()
        {
            int geometrystart = geoJSONString.IndexOf(GeometryLineStringLocatorString, featureStartIndex, featureLength) + GeometryLineStringLocatorString.Length;
            int geometryEnd   = geoJSONString.IndexOf(GeometryLineStringLocatorEndString, geometrystart) - 1;

            doubleOutputList.Clear();
            int counter = 1;

            for (int i = geometrystart; i < geometryEnd; i++)
            {
                if (geoJSONString[i] == ',')
                {
                    counter++;
                }
            }
            if (doubleOutputList.Capacity < counter)
            {
                doubleOutputList.Capacity = counter;
            }
            int nextstartposition = geometrystart;

            counter = 0;
            while (nextstartposition < geometryEnd)
            {
                doubleOutputList.Add((float)StringManipulation.ParseNextDouble(geoJSONString, ',', nextstartposition, out nextstartposition));
                counter++;
            }

            return(doubleOutputList);
        }
Exemplo n.º 2
0
        public double[] getGeometryPoint2DDouble()
        {
            int geometrystart = geoJSONString.IndexOf(GeometryPointLocatorString, featureStartIndex, featureLength) + GeometryPointLocatorString.Length;

            double[] output = new double[2];
            int      nextstartpostion;

            output[0] = StringManipulation.ParseNextDouble(geoJSONString, ',', geometrystart, out nextstartpostion);
            output[1] = StringManipulation.ParseNextDouble(geoJSONString, ',', nextstartpostion, out nextstartpostion);
            return(output);
        }
Exemplo n.º 3
0
        public float getPropertyFloatValue(string propertyName)
        {
            int propertyStartIndex = geoJSONString.IndexOf(propertyName, featureStartIndex, featureLength) + propertyName.Length + 1;

            if (propertyStartIndex == -1)
            {
                return(float.MaxValue);
            }
            int nextstartposition;

            return((float)StringManipulation.ParseNextDouble(geoJSONString, ',', propertyStartIndex, out nextstartposition));
        }