-
-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database returns nil
for valid MultiPolygon
#291
Comments
In the |
If it still doesn't parse after resolving that issue, it is likely an issue with the rgeo gem. Here's a similar test that might also help you isolate the problem, and is an example of where you could add a failing test in a PR (if needed): |
The 0106000020E610000001000000010300000004000000620000003DCA486CE2985EC010BBEDFABDE34240DEA7AC2AE2985EC0BDF16C68BEE3424033D38B2AE2985EC0BDA83B73BEE342406D705F0EE1985EC00663EA49C0E34240F767370AE1985EC04731CE49C0E3424079C93B85E0985EC02ECBBA27C1E34240C1E5CEE3D1985EC0F30D3BA4A9E3424058275EF4D1985EC0E9C5D7B3A8E3424047F3D0E5D1985EC00793E7ACA8E34240DD2EBDCED1985EC0AA573F75A8E342404C9EA3CED1985EC014CBF574A8E34240EA7D10FDD1985EC0C3C6716EA7E34240561B5C1ED2985EC077C42B54A7E34240824D9334D2985EC0E70F035EA7E342406E9DCC6BD2985EC0493D74A6A6E34240AACC264BD3985EC067B857D8A4E34240FBF8915ED4985EC05AEC29C0A3E342406EC872C8D5985EC02038960FA3E342402F2B07B6D5985EC042759A52A1E34240A563178CD4985EC03562FD83A1E34240E39B8F88D4985EC0EA308B45A1E34240EDB6807BD4985EC09A77905EA0E3424035543F76D4985EC04AFE9C01A0E34240FB3B3376D4985EC0768BBC00A0E3424023D99B66D4985EC093A1F5EC9EE3424073DB8466D4985EC07F0A67EB9EE34240B514CD59D4985EC0EC906E0A9EE34240D4AD3A3ED4985EC0F59AA3229CE34240FBA43829D4985EC0EE54C4F49AE3424082397A0FF3985EC0BD75178B83E34240E6E017A0F3985EC0F2C8952B84E3424091D38782F6985EC04BBB1CFB81E342407AB2A5CAF6985EC0A31CCA3B82E34240E597D7CBF6985EC0C128675F82E3424028034796F7985EC0E06A6F4183E34240B580D985F7985EC0BEF2EE6A83E342405B362441F8985EC040C4B13284E3424093AD8B5BF8985EC00291F7F783E342406EAA1A86F8985EC0129961EB83E34240295E6B0FF9985EC021E50F8684E342403846810FF9985EC09B3E5F8684E342403CEEAC14F9985EC0556429C184E342405F7D9EFCF8985EC02FDB6CFA84E34240BFFC50D0F9985EC0E733AAD885E34240AFA51C91F9985EC05139506186E34240E6E84B6FF9985EC03CD5B2AF86E342401F247893FB985EC0C9671A3089E34240808B5F0EFF985EC044A8E4408DE342408EB0BA0CFF985EC0D78473448DE34240D8BBEE0EFF985EC004B90B478DE34240B4EF8173FF985EC08523B6668CE34240DDEBA97702995EC0EFD8187C85E34240162693D108995EC02D29F27D8FE34240980DA9D108995EC06D3F497E8FE34240AFE21EB605995EC04219612A96E342409317544106995EC02AC482C396E34240869A784106995EC0F63C0AC496E34240055F050906995EC0E0D1344597E342408D0BCCC305995EC06023D6FA96E342402E3EAF7303995EC08EBD3B449CE34240BA4AA4B103995EC05A7A61869CE342406205CAB103995EC0B2F3E8869CE34240D408A47B03995EC0D9DFE50D9DE34240722A921603995EC07117299E9CE34240EE23698A02995EC0D13393EE9DE34240BE965A9F02995EC0E2B59D9D9FE34240B2DB254003995EC04875E88BA0E3424086A8CEBA03995EC00C8B7CC99FE34240AEDC58F703995EC078258ECC9FE3424012CCEB6C05995EC04BEBF52CA2E3424079B21D6D05995EC0C2D6AB2DA2E342403285BC6C05995EC0749C3C7EA2E34240106C312D04995EC0E434FE7AA4E3424003F76C3304995EC01684ED85A4E34240F679913304995EC08D0D7386A4E34240FCADFDC0FD985EC070FA77BEAEE34240755EFBB6F4985EC0C9FD5F11BDE3424072F7A0ADF4985EC0098EBFFFBCE34240F0A3FEB3EC985EC0B30DD0DBC9E34240AD24B202EC985EC0EDC334D0C8E3424043E5B837EB985EC0771B0813CAE34240870A1CB0EB985EC0CFE825D2CAE34240AC4155B0EB985EC00B3BD0D2CAE34240F35540B0EB985EC08D615B26CBE34240001DD72EEA985EC0E6AA8C83CDE342402CF3DBF6E9985EC069DA9C83CDE34240E880C882E9985EC003ECF8C9CCE34240E6898AB5E8985EC0656C6610CEE342409FFB52DCE7985EC01718429FCCE34240A84A48FCE1985EC0B4896753C3E34240D1071AFCE1985EC0D1ECE352C3E34240E9A39AFAE1985EC09447A336C3E342409FD29EB8E1985EC02C3534CEC2E34240ED9A65B8E1985EC042A091CDC2E3424052DC3BD3E1985EC0105488A2C2E342403EAACD6FE1985EC091CBDF00C2E3424043C0FA3BE3985EC02C077A43BFE342403DCA486CE2985EC010BBEDFABDE342402B000000150C02A0EF985EC0103C2E51AFE3424017EE4821F6985EC0D50DFA0AA5E34240C86D4487F6985EC02FD8F7ACA5E34240BD2BFEBDF6985EC05CBBED48A5E34240DA9C4C34F7985EC04E0CD45DA4E34240D99F6874F7985EC0E015516CA3E34240B1B89595F7985EC07C462171A2E34240C26E90A9F7985EC013DD4568A1E34240BCBF4FA1F7985EC0A2B28651A0E34240998EFE6CF7985EC06E526A619FE34240C3FD2924F7985EC056FD5E6C9EE34240AC0D5CC5F6985EC0F8B0E59F9DE3424005649246F6985EC00443B3D09CE3424021FB1398F5985EC01730171B9CE3424087BB10D2F4985EC011E5014D9BE342401233BE8AF4985EC0378427EC9BE34240CE570545EC985EC0EE9633A492E3424003DD1842EC985EC00E316EA592E342407B6B6B7BE9985EC0CB4FB14792E34240AE093D34E8985EC0013C189190E34240E42133B1E7985EC0DDBDBDA28EE34240091FDC31E7985EC014E811068FE34240911E212BE1985EC0487DF74393E342403595F8D3E0985EC0CDA0393195E34240E5762AB0DC985EC05D5FB35098E3424035FB89B0DC985EC073DFF45798E34240E9A5BEB9DC985EC062EF675198E34240BBC26E24DD985EC085F733C5A0E34240FFAB1B2ADD985EC063CF79C4A0E34240FA022789DD985EC0385ABA0AA8E34240EA3D3884DD985EC0117E5D0BA8E342405C3956AFDD985EC0942FDBAEAAE34240702A9EB6DD985EC045587AABAAE3424058B1F82AE6985EC0791D1513B8E3424003A8E184E3985EC0BD9BDF52BCE34240A4779376E4985EC0D5130EEBBDE34240B2DD796EE7985EC0F1B107B6B8E34240C249676EE7985EC0816BD7B8B8E34240348F846EE7985EC08014A7B8B8E34240D04B0514E8985EC0D1DBAB18B9E3424007E536DFE9985EC01429229CB5E34240E5216263EB985EC0661706F9B3E34240150C02A0EF985EC0103C2E51AFE342400B00000084632018DB985EC011522955A8E34240EED48BD1DA985EC07437D012A3E3424005C703B1DA985EC0DF2A6324A1E34240E248B618D9985EC01FF83258A1E34240365C222AD9985EC02DF38CD9A2E3424015B05FD4D8985EC0764B5BE5A2E3424023CBF20FD9985EC0A094B53BA7E3424083341155D9985EC0C74AB134A7E34240AAEC0369D9985EC006AFA08DA8E34240CCC9DF5EDA985EC0849C6E6DA8E3424084632018DB985EC011522955A8E34240060000004AF9FEEFDB985EC02BB3E8FBA0E34240366C114ADC985EC008D0132DA8E34240337B2583DC985EC056179A25A8E342408099E77CDD985EC0579EDB04A8E34240321D081FDD985EC04F4274D5A0E342404AF9FEEFDB985EC02BB3E8FBA0E34240 The Manually calling the #<RGeo::Error::ParseError: Unknown type value: 536870918.> Interestingly, the exception is not raised during the call to the |
Has anyone found a solution for this? |
I just found what was wrong in my case, i was trying to parse a the snippet: factory_generator_ = RGeo::Cartesian.preferred_factory(srid: 4326)
parser = RGeo::WKRep::WKBParser.new(factory_generator_, support_ewkb: true)
parser.parse("0103000020E61000000100000006000000A25D85949FE964C011DF89592F0455C055302AA9130A61405B94D920938053C0BD18CA8976014F4087A757CA320C3DC0840D4FAF94E363406AF6402B303047C02B90740C03472C40884FA07494FCFDBFA25D85949FE964C011DF89592F0455C0") result:
|
Seems issue can be closed? |
I'm going to leave this open for now because it could be related to #312 and rgeo/rgeo#218. |
Closing since this is caused by the issue I talk about in #319. The original polygon was written was a GEOS factory, but read with a spherical factory (due to the migration specifying |
PostGIS version is 2.5.0 installed via Homebrew.
Rubygem versions (from
Gemfile.lock
):I am trying to import the contents of a CSV file. The geometries are saved "successfully". However, for certain rows of the CSV file, attempts to retrieve the data from the corresponding records in the database using
activerecord-postgis-adapter
for deserialization returnnil
.For example, line 156407 of the CSV file (c.f., https://dev.socrata.com/foundry/data.sfgov.org/2s2t-jwzp) contains the following well-known text for the geometry for AT&T Park in San Francisco:
The
RGeo::Geos.factory.parse_wkt
method returns an instance of theRGeo::Geos::CAPIMultiPolygonImpl
class. The instance is serialized and written to the database successfully. However, attempts to retrieve the instance from the database returnnil
. (This is surprising because there is aNOT NULL
constraint on the database column for the geometry.)Manually executed SQL statements that call the
ST_IsValid
function on the saved geometry for the record return true.Manually executed SQL statements that call the
ST_AsText
function on the saved geometry for the record return the original well-known text for the geometry. This suggests that there may be an issue with deserialization.The migration for the database column is:
The text was updated successfully, but these errors were encountered: