[freeside-commits] branch FREESIDE_3_BRANCH updated. 0ec32a822d5be7339c232f8096e37b1ec8ba8d0a

Ivan Kohler ivan at freeside.biz
Wed Sep 21 14:28:02 PDT 2022


The branch, FREESIDE_3_BRANCH has been updated
       via  0ec32a822d5be7339c232f8096e37b1ec8ba8d0a (commit)
      from  e5f2faa44d1c650f187c92fa06d901372dad490e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0ec32a822d5be7339c232f8096e37b1ec8ba8d0a
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Sep 21 14:28:01 2022 -0700

    fix deployment zone creation/edit, new census data, RT#86793, RT#86460

diff --git a/FS/FS/deploy_zone.pm b/FS/FS/deploy_zone.pm
index 16ba5ddf3..c618fb987 100644
--- a/FS/FS/deploy_zone.pm
+++ b/FS/FS/deploy_zone.pm
@@ -13,8 +13,7 @@ use HTTP::Request::Common;
 use Geo::JSON::Polygon;
 use Geo::JSON::Feature;
 
-# update this in 2020, along with the URL for the TIGERweb service
-our $CENSUS_YEAR = 2010;
+our $CENSUS_YEAR = 2020;
 
 our $tech_label  = FS::part_pkg_fcc_option->technology_labels;
 
@@ -457,7 +456,7 @@ sub process_block_lookup {
     inSR            => 4326,
     outSR           => 4326,
     spatialRel      => 'esriSpatialRelIntersects', # the test to perform
-    outFields       => 'OID,GEOID',
+    outFields       => 'GEOID',
     returnGeometry  => 'false',
     orderByFields   => 'OID',
   );
@@ -481,16 +480,12 @@ sub process_block_lookup {
 
   #warn "Census block lookup: $count\n";
 
-  # we have to do our own pagination on this, because the census bureau
-  # doesn't support resultOffset (maybe they don't have ArcGIS 10.3 yet).
-  # that's why we're ordering by OID, it's globally unique
-  my $last_oid = 0;
   my $done = 0;
   while (!$done) {
     $response = $ua->request(
       POST $url, Content => [
         %query,
-        where => "OID>$last_oid",
+        resultOffset => $inserted,
       ]
     );
     die $response->status_line unless $response->is_success;
@@ -515,7 +510,6 @@ sub process_block_lookup {
     }
 
     #warn "Inserted $inserted records\n";
-    $last_oid = $data->{features}[-1]{attributes}{OID};
     $done = 1 unless $data->{exceededTransferLimit};
   }
 

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/deploy_zone.pm | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)




More information about the freeside-commits mailing list