Beispiel #1
0
        public FeatureCollection GetSalesTaxJursitictionBoundaries(int year, int quarter, int outSR = _defaultSrid)
        {
            ProjectionInfo targetProjection = outSR == _defaultSrid ? null : ProjectionInfo.FromEpsgCode(outSR);
            var            boundaries       = DorTaxRateReader.EnumerateLocationCodeBoundaries(new QuarterYear(year, quarter), targetProjection);
            var            aliases          = new Dictionary <string, string>();

            aliases.Add("LOCCODE", "LocationCode");
            var featureCollection = boundaries.ToNtsFeatureCollection(outSR, _omittedFields, aliases);

            return(featureCollection);
        }
Beispiel #2
0
        public void GetLocationCodeBoundaries()
        {
            const int srid             = 4326;
            var       targetProjection = ProjectionInfo.FromEpsgCode(srid);
            var       boundaries       = DorTaxRateReader.EnumerateLocationCodeBoundaries(QuarterYear.Current, targetProjection);

            Assert.IsNotNull(boundaries);

            foreach (Feature feature in boundaries)
            {
                if (feature.BasicGeometry == null)
                {
                    Assert.Fail("All features should have geometry.");
                    var polygon = feature.BasicGeometry as Polygon;
                    if (polygon == null)
                    {
                        var multipoly = feature.BasicGeometry as MultiPolygon;
                        if (multipoly == null)
                        {
                            Assert.Fail("All geometries must be either polygon or multipolygon.");
                        }
                    }
                    break;
                }
                if (feature.DataRow == null)
                {
                    Assert.Fail("All features should have attributes.");
                    break;
                }
                else if (feature.DataRow["LOCCODE"] == null)
                {
                    Assert.Fail("All features should have \"LOCCODE\" attribute.");
                    break;
                }
            }
        }