Beispiel #1
0
        public datacontract.municipality getMunicipalitiy(int NIScode, CRS srs, capakeyGeometryType geomType)
        {
            qryValues.Add("srs", Convert.ToString((int)srs));
            if (geomType == capakeyGeometryType.no)
            {
                qryValues.Add("geometry", "no");
            }
            else if (geomType == capakeyGeometryType.bbox)
            {
                qryValues.Add("geometry", "bbox");
            }
            else if (geomType == capakeyGeometryType.full)
            {
                qryValues.Add("geometry", "full");
            }

            client.QueryString = qryValues;
            Uri    gipodUri = new Uri(baseUri + "Municipality/" + NIScode.ToString());
            string json     = client.DownloadString(gipodUri);

            datacontract.municipality response = JsonConvert.DeserializeObject <datacontract.municipality>(json);

            client.QueryString.Clear();
            return(response);
        }
Beispiel #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void verifyCRSStructure(org.neo4j.graphdb.spatial.CRS crs) throws java.io.IOException
        private void VerifyCRSStructure(CRS crs)
        {
            // When
            _jsonCodec.writeValue(_jsonGenerator, crs);

            // Then verify in order
            InOrder inOrder = Mockito.inOrder(_jsonGenerator);

            // Start CRS object
            inOrder.verify(_jsonGenerator).writeStartObject();
            // Code
            inOrder.verify(_jsonGenerator).writeFieldName("srid");
            inOrder.verify(_jsonGenerator).writeNumber(crs.Code);
            // Name
            inOrder.verify(_jsonGenerator).writeFieldName("name");
            inOrder.verify(_jsonGenerator).writeString(crs.Type);
            // Type
            inOrder.verify(_jsonGenerator).writeFieldName("type");
            inOrder.verify(_jsonGenerator).writeString("link");
            // Properties
            inOrder.verify(_jsonGenerator).writeFieldName("properties");
            // Properties object
            inOrder.verify(_jsonGenerator).writeStartObject();
            inOrder.verify(_jsonGenerator).writeFieldName("href");
            inOrder.verify(_jsonGenerator).writeString(startsWith(crs.Href));
            inOrder.verify(_jsonGenerator).writeFieldName("type");
            inOrder.verify(_jsonGenerator).writeString("ogcwkt");
            // Close both properties and CRS objects
            inOrder.verify(_jsonGenerator, times(2)).writeEndObject();
        }
Beispiel #3
0
        /// <summary>
        /// Returns the compressed row storage (CRS) representation of the sparse matrix.
        /// </summary>
        /// <typeparam name="K">The type of keys.</typeparam>
        /// <typeparam name="T">The type of entry values.</typeparam>
        /// <param name="sparseMatrix">The sparse matrix to compress.</param>
        /// <returns>The compressed row storage (CRS) representation of the sparse matrix.</returns>
        public static CRS <T> ToCRS <K, T>(this DOKSparseMatrixBase <K, T> sparseMatrix)
        {
            CRS <T> crs = new CRS <T>(sparseMatrix.Size);

            crs.Compress(sparseMatrix);
            return(crs);
        }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: private static org.neo4j.graphdb.spatial.Geometry makeFakePointAsGeometry(double x, double y, final org.neo4j.graphdb.spatial.CRS crs)
        private static Geometry MakeFakePointAsGeometry(double x, double y, CRS crs)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.graphdb.spatial.Coordinate coord = new org.neo4j.graphdb.spatial.Coordinate(x, y);
            Coordinate coord = new Coordinate(x, y);

            return(new GeometryAnonymousInnerClass(crs, coord));
        }
Beispiel #5
0
        private void CRS_Click(object sender, EventArgs e)
        {
            if (loadStructures() != 0)
            {
                return;
            }
            string mat = new CRS(matrix).serialize();

            resultsTextBox.Text = "CRS format:" + Environment.NewLine + mat;
        }
Beispiel #6
0
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 /// <returns>
 /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (_envelope != null ? _envelope.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CRS != null ? CRS.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)Type;
         return(hashCode);
     }
 }
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 /// <returns>
 /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (BoundingBoxes != null ? BoundingBoxes.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CRS != null ? CRS.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)Type;
         return(hashCode);
     }
 }
Beispiel #8
0
        /// <summary>
        /// Checks MODULE for correct format.
        /// </summary>
        /// <returns></returns>
        private bool CheckModule()
        {
            //Currently check only CRS
            if (m_strEquation.Substring(7, 3) == "CRS")
            {
                List <String> listAttributesEquation = Global.ParseAttribute(m_strEquation);            // See if listAttributeEquations is included in dgvDefault
                if (listAttributesEquation.Count != 6)
                {
                    return(false);
                }

                CRS    crs         = new CRS();
                String strType     = GetCheckString(listAttributesEquation[0].ToString());
                double dCRSOld     = GetCheckValue(listAttributesEquation[1].ToString());
                double dThick      = GetCheckValue(listAttributesEquation[2].ToString());
                double dESAL       = GetCheckValue(listAttributesEquation[3].ToString());
                double dESALGrowth = GetCheckValue(listAttributesEquation[4].ToString());
                double dAge        = GetCheckValue(listAttributesEquation[5].ToString());
                double dBenefit    = 0;
                double dRSL        = 0;
                double dMaximum;
                double dMinimum;
                dgvPerformance.Rows.Clear();
                dgvPerformance.Rows.Add(0, dCRSOld);
                for (int i = 1; i < 99; i++)
                {
                    dAge = (double)i;
                    double dValue = crs.CalculateCRSBenefit(false, strType, dCRSOld, dThick, dESAL, dESALGrowth, 1, dAge, 3, out dBenefit, out dRSL);
                    if (Global.GetAttributeMaximum(m_strAttribute, out dMaximum))
                    {
                        if (dValue > dMaximum)
                        {
                            dValue = dMaximum;
                        }
                    }

                    if (Global.GetAttributeMinimum(m_strAttribute, out dMinimum))
                    {
                        if (dValue < dMinimum)
                        {
                            dValue = dMinimum;
                        }
                    }

                    dgvPerformance.Rows.Add(i.ToString(), dValue.ToString("f2"));
                }
                return(true);
            }
            else if (m_strEquation.Substring(7, 3) == "OCI")
            {
                return(true);
            }
            return(false);
        }
Beispiel #9
0
        public datacontract.poiMinResponse getMinmodel(string q = null, bool Clustering=false, string theme = null, string category = null, 
            string POItype = null, CRS srs = CRS.WGS84, int? id = null, string niscode = null, boundingBox bbox = null)
        {
            setQueryValues(q, 1024, Clustering, false, theme, category, POItype, srs, id, niscode, bbox );
            client.QueryString = qryValues;

            string json = client.DownloadString(baseUrl);

            datacontract.poiMinResponse poiResponse = JsonConvert.DeserializeObject<datacontract.poiMinResponse>(json);

            client.QueryString.Clear();

            return poiResponse;
        }
Beispiel #10
0
        public datacontract.poiMinResponse getMinmodel(string q       = null, bool Clustering = false, string theme = null, string category = null,
                                                       string POItype = null, CRS srs         = CRS.WGS84, int?id   = null, string niscode  = null, boundingBox bbox = null)
        {
            setQueryValues(q, 1024, Clustering, false, theme, category, POItype, srs, id, niscode, bbox);
            client.QueryString = qryValues;

            string json = client.DownloadString(baseUrl);

            datacontract.poiMinResponse poiResponse = JsonConvert.DeserializeObject <datacontract.poiMinResponse>(json);

            client.QueryString.Clear();

            return(poiResponse);
        }
Beispiel #11
0
        public datacontract.municipality getMunicipalitiy(int NIScode, CRS srs, capakeyGeometryType geomType)
        {
            qryValues.Add("srs", Convert.ToString((int)srs));
            if (geomType == capakeyGeometryType.no) qryValues.Add("geometry", "no");
            else if (geomType == capakeyGeometryType.bbox) qryValues.Add("geometry", "bbox");
            else if (geomType == capakeyGeometryType.full) qryValues.Add("geometry", "full");

            client.QueryString = qryValues;
            Uri gipodUri = new Uri(baseUri + "Municipality/" + NIScode.ToString() );
            string json = client.DownloadString(gipodUri);
            datacontract.municipality response = JsonConvert.DeserializeObject<datacontract.municipality>(json);

            client.QueryString.Clear();
            return response;
        }
Beispiel #12
0
        //manifestation
        public List <datacontract.gipodResponse> getManifestation(
            DateTime?startdate = null, DateTime?enddate = null,
            string city        = "", string province    = "", string owner = "", string eventtype = "",
            CRS CRS            = CRS.WGS84, int c = 50, int offset         = 0, boundingBox bbox  = null)
        {
            setQueryValues(startdate, enddate, city, province, owner, eventtype, CRS, c, offset, bbox);

            client.QueryString = qryValues;

            Uri    gipodUri = new Uri("http://gipod.api.agiv.be/ws/v1/manifestation");
            string json     = client.DownloadString(gipodUri);

            List <datacontract.gipodResponse> gipodRespons = JsonConvert.DeserializeObject <List <datacontract.gipodResponse> >(json);

            client.QueryString.Clear();
            return(gipodRespons);
        }
Beispiel #13
0
        public List<List<double>> getDataAlongLine( datacontract.geojsonLine profileLine, int nrSamples = 30, CRS srs = CRS.WGS84)
        {
            client.Headers[HttpRequestHeader.ContentType] = "application/json";

            Uri dhmUri = new Uri(baseUri + "DHMVMIXED/request/");
            datacontract.dhmRequest dhmMsg = new datacontract.dhmRequest() {
                Samples = nrSamples, LineString = profileLine, SrsIn= (int)srs , SrsOut= (int)srs };

            string postData = JsonConvert.SerializeObject(dhmMsg);
            byte[] byteArray = System.Text.Encoding.ASCII.GetBytes(postData);
            byte[] byteResult = client.UploadData(dhmUri, "POST", byteArray);

            string json = Encoding.ASCII.GetString(byteResult);
            List<List<double>> response = JsonConvert.DeserializeObject<List<List<double>>>(json);

            return response;
        }
Beispiel #14
0
        //manifestation
        public List<datacontract.gipodResponse> getManifestation( 
                DateTime? startdate = null, DateTime? enddate = null,
                string city = "", string province = "", string owner = "", string eventtype = "",
                CRS CRS = CRS.WGS84, int c = 50, int offset = 0, boundingBox bbox = null )
        {
            setQueryValues(startdate, enddate, city, province, owner, eventtype, CRS, c, offset, bbox);

            client.QueryString = qryValues;

            Uri gipodUri = new Uri("http://gipod.api.agiv.be/ws/v1/manifestation");
            string json = client.DownloadString(gipodUri);

            List<datacontract.gipodResponse> gipodRespons = JsonConvert.DeserializeObject<List<datacontract.gipodResponse>>(json);

            client.QueryString.Clear();
            return gipodRespons;
        }
Beispiel #15
0
        private void Add(string json, CRS crs)
        {
            var request = new RestRequest();

            request.Resource = "layers/{id}/data";
            request.Method   = Method.POST;

            request.AddUrlSegment("id", this.id);
            request.AddQueryParameter("op", "create");
            request.AddParameter("data", json);
            if (crs != null)
            {
                request.AddParameter("crs", JsonConvert.SerializeObject(crs));
            }

            this.Execute(request);
        }
Beispiel #16
0
        public List<datacontract.gipodResponse> allWorkassignments(DateTime? startdate = null, DateTime? enddate = null,
                string city = "", string province = "", string owner = "", CRS CRS = CRS.WGS84, boundingBox bbox = null)
        {
            List<datacontract.gipodResponse> allWA = new List<datacontract.gipodResponse>();
            List<datacontract.gipodResponse> WA = getWorkassignment(startdate, enddate, city, province, owner, CRS, 500, 0, bbox);

            allWA.AddRange(WA);

            int counter = 0;

            while (WA.Count == 500)
            {
                counter += 500;
                WA = getWorkassignment(startdate, enddate, city, province, owner, CRS, 500, counter);
                allWA.AddRange(WA);
            }
            return allWA;
        }
Beispiel #17
0
        public void Update(string condition, Feature feature, CRS crs)
        {
            var request = new RestRequest();

            request.Resource = "layers/{id}/data";
            request.Method   = Method.POST;

            request.AddUrlSegment("id", this.id);
            request.AddQueryParameter("op", "update");
            request.AddParameter("data", JsonConvert.SerializeObject(feature));
            if (crs != null)
            {
                request.AddParameter("crs", JsonConvert.SerializeObject(crs));
            }
            request.AddParameter("condition", condition);

            this.Execute(request);
        }
Beispiel #18
0
        private void CRSx_Click(object sender, EventArgs e)
        {
            if (loadStructures() != 0)
            {
                return;
            }
            resultsTextBox.Text  = "CRS Matrix Multiplication:" + Environment.NewLine + Environment.NewLine;
            resultsTextBox.Text += "M =" + Environment.NewLine;
            CRS mat = new CRS(matrix);

            resultsTextBox.Text += mat.serialize();
            resultsTextBox.Text += Environment.NewLine + Environment.NewLine;
            resultsTextBox.Text += "V =" + Environment.NewLine;
            resultsTextBox.Text += String.Join(" ", vector.Select(x => x.ToString()).ToArray());
            resultsTextBox.Text += Environment.NewLine + Environment.NewLine;
            resultsTextBox.Text += "M*V =" + Environment.NewLine;
            double[] res = mat.vectorMultiply(vector);
            resultsTextBox.Text += String.Join(" ", res.Select(x => x.ToString()).ToArray());
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotReturnInternalCartesianPointType()
        public virtual void ShouldNotReturnInternalCartesianPointType()
        {
            // when
            Result execute = GraphDb.execute("RETURN point({x: 13.37, y: 13.37, crs:'cartesian'}) AS p");

            // then
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            object obj = execute.Next()["p"];

            assertThat(obj, Matchers.instanceOf(typeof(Point)));

            Point point = ( Point )obj;

            assertThat(point.Coordinate, equalTo(new Coordinate(13.37, 13.37)));

            CRS crs = point.CRS;

            assertThat(crs.Code, equalTo(7203));
            assertThat(crs.Type, equalTo("cartesian"));
            assertThat(crs.Href, equalTo("http://spatialreference.org/ref/sr-org/7203/"));
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotReturnInternalGeographicPointType()
        public virtual void ShouldNotReturnInternalGeographicPointType()
        {
            // when
            Result execute = GraphDb.execute("RETURN point({longitude: 144.317718, latitude: -37.031738}) AS p");

            // then
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            object obj = execute.Next()["p"];

            assertThat(obj, Matchers.instanceOf(typeof(Point)));

            Point point = ( Point )obj;

            assertThat(point.Coordinate.Coordinate[0], equalTo(144.317718));
            assertThat(point.Coordinate.Coordinate[1], equalTo(-37.031738));

            CRS crs = point.CRS;

            assertThat(crs.Code, equalTo(4326));
            assertThat(crs.Type, equalTo("wgs-84"));
            assertThat(crs.Href, equalTo("http://spatialreference.org/ref/epsg/4326/"));
        }
Beispiel #21
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: private MockGeometry(String geometryType, final java.util.List<org.neo4j.graphdb.spatial.Coordinate> coordinates, final org.neo4j.graphdb.spatial.CRS crs)
            internal MockGeometry(string geometryType, IList <Coordinate> coordinates, CRS crs)
            {
                this.GeometryTypeConflict = geometryType;
                this.CoordinatesConflict  = coordinates;
                this.Crs = crs;
            }
Beispiel #22
0
 public static MockPoint3D MockPoint(double x, double y, double z, CRS crs)
 {
     return(new MockPoint3D(x, y, z, crs));
 }
Beispiel #23
0
 public static CoordinateReferenceSystem Get(CRS crs)
 {
     Objects.requireNonNull(crs);
     return(Get(crs.Href));
 }
 public GeometryAnonymousInnerClass(CRS crs, Coordinate coord)
 {
     this._crs   = crs;
     this._coord = coord;
 }
Beispiel #25
0
        private void setQueryValues(string q     = "", int c = 30, bool Clustering = false, bool maxModel         = false,
                                    string theme = null, string category = null, string POItype   = null, CRS srs = CRS.WGS84,
                                    int?id       = null, string niscode  = null, boundingBox bbox = null)
        {
            qryValues.Clear();

            if (q != null || q != "")
            {
                qryValues.Add("keyword", q);
            }

            if (Clustering && !maxModel)
            {
                qryValues.Add("Clustering", "true");
            }
            else
            {
                qryValues.Add("Clustering", "false");
            }
            //srs
            qryValues.Add("srsIn", Convert.ToString((int)srs));
            qryValues.Add("srsOut", Convert.ToString((int)srs));
            //string lists
            if (id != null)
            {
                qryValues.Add("id", id.ToString());
            }
            if (niscode != null || niscode != "")
            {
                qryValues.Add("region", niscode);
            }
            if (theme != null || theme != "")
            {
                qryValues.Add("theme", theme);
            }
            if (category != null || category != "")
            {
                qryValues.Add("category", category);
            }
            if (POItype != null || POItype != "")
            {
                qryValues.Add("POItype", POItype);
            }
            qryValues.Add("maxcount", c.ToString());

            if (maxModel)
            {
                qryValues.Add("maxmodel", "true");
            }
            else
            {
                qryValues.Add("maxmodel", "false");
            }

            if (bbox != null)
            {
                qryValues.Add("bbox", bbox.ToBboxString("|", "|"));
            }
        }
Beispiel #26
0
 public static MockGeometry MockGeometry(string geometryType, IList <Coordinate> coordinates, CRS crs)
 {
     return(new MockGeometry(geometryType, coordinates, crs));
 }
Beispiel #27
0
        private void setQueryValues(string q = "", int c = 30, bool Clustering = false, bool maxModel = false,
             string theme = null, string category = null, string POItype = null, CRS srs = CRS.WGS84, 
             int? id = null, string niscode = null, boundingBox bbox = null)
        {
            qryValues.Clear();

            if (q != null || q != "") qryValues.Add("keyword", q);

            if (Clustering && !maxModel ) qryValues.Add("Clustering", "true");
            else qryValues.Add("Clustering", "false");
            //srs
            qryValues.Add("srsIn", Convert.ToString((int)srs));
            qryValues.Add("srsOut", Convert.ToString((int)srs));
            //string lists
            if (id != null ) qryValues.Add("id", id.ToString());
            if (niscode != null || niscode != "") qryValues.Add("region", niscode);
            if (theme != null || theme != "" ) qryValues.Add("theme", theme);
            if (category != null || category != "" ) qryValues.Add("category", category);
            if (POItype != null || POItype != "" ) qryValues.Add("POItype", POItype);
            qryValues.Add("maxcount", c.ToString());

            if (maxModel)
            {
                qryValues.Add("maxmodel", "true");
            }
            else
            {
                qryValues.Add("maxmodel", "false");
            }

            if (bbox != null) qryValues.Add("bbox", bbox.ToBboxString("|", "|"));
        }
Beispiel #28
0
        private void setQueryValues(DateTime? startdate, DateTime? enddate, 
            string city, string province, string owner, string eventtype, CRS sRS, int c, int offset, boundingBox bbox = null)
        {
            //counters
            qryValues.Add("offset", offset.ToString());
            qryValues.Add("limit", c.ToString());
            //string lists
            if (city != "" || city != null) qryValues.Add("city", city);
            if (province != "" || province != null) qryValues.Add("province", province);
            if (owner != "" || owner != null) qryValues.Add("owner", owner);
            if (eventtype != "" || eventtype != null) qryValues.Add("eventtype", eventtype);
            //CRS
            qryValues.Add("CRS", Convert.ToString((int)sRS));

            //Time
            if (startdate != null) qryValues.Add("startdate", startdate.Value.ToString("yyyy-MM-dd"));
            if (enddate != null) qryValues.Add("enddate", enddate.Value.ToString("yyyy-MM-dd"));

            //bbox
            if (bbox != null) qryValues.Add("bbox", bbox.ToBboxString(",", "|") );
        }
Beispiel #29
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: private MockPoint3D(final double x, final double y, double z, final org.neo4j.graphdb.spatial.CRS crs)
            internal MockPoint3D(double x, double y, double z, CRS crs) : base("Point", new List <Coordinate>(), crs)
            {
                this.Coordinate = new Coordinate(x, y, z);
                this.CoordinatesConflict.Add(this.Coordinate);
            }
Beispiel #30
0
        public List <List <double> > getDataAlongLine(datacontract.geojsonLine profileLine, int nrSamples = 30, CRS srs = CRS.WGS84)
        {
            client.Headers[HttpRequestHeader.ContentType] = "application/json";

            Uri dhmUri = new Uri(baseUri + "DHMVMIXED/request/");

            datacontract.dhmRequest dhmMsg = new datacontract.dhmRequest()
            {
                Samples = nrSamples, LineString = profileLine, SrsIn = (int)srs, SrsOut = (int)srs
            };

            string postData = JsonConvert.SerializeObject(dhmMsg);

            byte[] byteArray  = System.Text.Encoding.ASCII.GetBytes(postData);
            byte[] byteResult = client.UploadData(dhmUri, "POST", byteArray);

            string json = Encoding.ASCII.GetString(byteResult);
            List <List <double> > response = JsonConvert.DeserializeObject <List <List <double> > >(json);

            return(response);
        }
Beispiel #31
0
        public List <datacontract.gipodResponse> allManifestations(DateTime?startdate = null, DateTime?enddate = null,
                                                                   string city        = "", string province    = "", string owner = "", string eventtype = "", CRS CRS = CRS.WGS84, boundingBox bbox = null)
        {
            List <datacontract.gipodResponse> allWA = new List <datacontract.gipodResponse>();
            List <datacontract.gipodResponse> WA    = getManifestation(startdate, enddate, city, province, owner, eventtype, CRS, 500, 0, bbox);

            allWA.AddRange(WA);

            int counter = 0;

            while (WA.Count == 500)
            {
                counter += 500;
                WA       = getManifestation(startdate, enddate, city, province, owner, eventtype, CRS, 500, counter);
                allWA.AddRange(WA);
            }
            return(allWA);
        }
Beispiel #32
0
        private void setQueryValues(DateTime?startdate, DateTime?enddate,
                                    string city, string province, string owner, string eventtype, CRS sRS, int c, int offset, boundingBox bbox = null)
        {
            //counters
            qryValues.Add("offset", offset.ToString());
            qryValues.Add("limit", c.ToString());
            //string lists
            if (city != "" || city != null)
            {
                qryValues.Add("city", city);
            }
            if (province != "" || province != null)
            {
                qryValues.Add("province", province);
            }
            if (owner != "" || owner != null)
            {
                qryValues.Add("owner", owner);
            }
            if (eventtype != "" || eventtype != null)
            {
                qryValues.Add("eventtype", eventtype);
            }
            //CRS
            qryValues.Add("CRS", Convert.ToString((int)sRS));

            //Time
            if (startdate != null)
            {
                qryValues.Add("startdate", startdate.Value.ToString("yyyy-MM-dd"));
            }
            if (enddate != null)
            {
                qryValues.Add("enddate", enddate.Value.ToString("yyyy-MM-dd"));
            }

            //bbox
            if (bbox != null)
            {
                qryValues.Add("bbox", bbox.ToBboxString(",", "|"));
            }
        }
Beispiel #33
0
 public static MockPoint MockPoint(double x, double y, CRS crs)
 {
     return(new MockPoint(x, y, crs));
 }
Beispiel #34
0
        public datacontract.parcel getParcel(int NIScode, int departmentCode, string sectie, string perceelsNr, CRS srs, capakeyGeometryType geomType)
        {
            qryValues.Add("srs", Convert.ToString((int)srs));
            if (geomType == capakeyGeometryType.no)
            {
                qryValues.Add("geometry", "no");
            }
            else if (geomType == capakeyGeometryType.bbox)
            {
                qryValues.Add("geometry", "bbox");
            }
            else if (geomType == capakeyGeometryType.full)
            {
                qryValues.Add("geometry", "full");
            }

            client.QueryString = qryValues;
            Uri    gipodUri = new Uri(baseUri + "Municipality/" + NIScode.ToString() + "/department/" + departmentCode.ToString() + "/section/" + sectie + "/parcel/" + perceelsNr);
            string json     = client.DownloadString(gipodUri);

            datacontract.parcel response = JsonConvert.DeserializeObject <datacontract.parcel>(json);

            client.QueryString.Clear();
            return(response);
        }
Beispiel #35
0
        /// <summary>
        /// 插入多个要素数据
        /// </summary>
        /// <param name="features">要素数据列表</param>
        /// <param name="crs">数据的坐标参考系</param>
        public void Add(List <Feature> features, CRS crs = null)
        {
            var data = JsonConvert.SerializeObject(features);

            this.Add(data, crs);
        }
Beispiel #36
0
 public static CoordinateReferenceSystem Crs(CRS crs)
 {
     return(CoordinateReferenceSystem.Get(crs));
 }
Beispiel #37
0
        /// <summary>
        /// 插入要素数据
        /// </summary>
        /// <param name="feature">要素数据,GeoJSON编码格式</param>
        /// <param name="crs">数据的坐标参考系</param>
        public void Add(Feature feature, CRS crs = null)
        {
            var data = JsonConvert.SerializeObject(feature);

            this.Add(data, crs);
        }
Beispiel #38
0
        public datacontract.parcel getParcel(int NIScode, int departmentCode, string sectie, string perceelsNr, CRS srs, capakeyGeometryType geomType)
        {
            qryValues.Add("srs", Convert.ToString((int)srs));
            if (geomType == capakeyGeometryType.no) qryValues.Add("geometry", "no");
            else if (geomType == capakeyGeometryType.bbox) qryValues.Add("geometry", "bbox");
            else if (geomType == capakeyGeometryType.full) qryValues.Add("geometry", "full");

            client.QueryString = qryValues;
            Uri gipodUri = new Uri(baseUri + "Municipality/" + NIScode.ToString() + "/department/" + departmentCode.ToString() + "/section/" + sectie + "/parcel/"+ perceelsNr);
            string json = client.DownloadString(gipodUri);
            datacontract.parcel response = JsonConvert.DeserializeObject<datacontract.parcel>(json);

            client.QueryString.Clear();
            return response;
        }