{"action":"created","issue":{"url":"https://api.github.com/repos/locationtech/jts/issues/273","repository_url":"https://api.github.com/repos/locationtech/jts","labels_url":"https://api.github.com/repos/locationtech/jts/issues/273/labels{/name}","comments_url":"https://api.github.com/repos/locationtech/jts/issues/273/comments","events_url":"https://api.github.com/repos/locationtech/jts/issues/273/events","html_url":"https://github.com/locationtech/jts/issues/273","id":306766717,"number":273,"title":"Geometry.copy() and SRID","user":{"login":"SPalominos","id":4136878,"avatar_url":"https://avatars3.githubusercontent.com/u/4136878?v=4","gravatar_id":"","url":"https://api.github.com/users/SPalominos","html_url":"https://github.com/SPalominos","followers_url":"https://api.github.com/users/SPalominos/followers","following_url":"https://api.github.com/users/SPalominos/following{/other_user}","gists_url":"https://api.github.com/users/SPalominos/gists{/gist_id}","starred_url":"https://api.github.com/users/SPalominos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SPalominos/subscriptions","organizations_url":"https://api.github.com/users/SPalominos/orgs","repos_url":"https://api.github.com/users/SPalominos/repos","events_url":"https://api.github.com/users/SPalominos/events{/privacy}","received_events_url":"https://api.github.com/users/SPalominos/received_events","type":"User","site_admin":false},"labels":[{"id":475422714,"url":"https://api.github.com/repos/locationtech/jts/labels/jts-core","name":"jts-core","color":"c5def5","default":false},{"id":316444017,"url":"https://api.github.com/repos/locationtech/jts/labels/type-bug","name":"type-bug","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-03-20T08:19:41Z","updated_at":"2018-04-05T21:58:34Z","closed_at":null,"author_association":"NONE","body":"With the last (1.15) release, it seems that the abstract method `Geometry.copy()` implementation doesn't copy the Geometry SRID.\r\n\r\nAs example, the following test on the Polygon class : \r\n```java\r\n@Test\r\n    public void testSRID(){\r\n        GeometryFactory factory = new GeometryFactory();\r\n        Coordinate[] coords = new Coordinate[]{\r\n                new Coordinate(0, 0),\r\n                new Coordinate(1, 0),\r\n                new Coordinate(1, 1),\r\n                new Coordinate(0, 1),\r\n                new Coordinate(0, 0),\r\n        };\r\n        Polygon polygon = factory.createPolygon(coords);\r\n        polygon.setSRID(4326);\r\n        Polygon copy = polygon.copy();\r\n        Assert.assertEquals(polygon.getSRID(), copy.getSRID());\r\n    }\r\n```\r\nreturns an error : `java.lang.AssertionError: Expected :4326 Actual   :0`\r\nIs it a normal behaviour ? Did I miss something and the SRID should be transmitted in an other way (maybe by setting the SRID on the `GeometryFactory`) ?"},"comment":{"url":"https://api.github.com/repos/locationtech/jts/issues/comments/379089537","html_url":"https://github.com/locationtech/jts/issues/273#issuecomment-379089537","issue_url":"https://api.github.com/repos/locationtech/jts/issues/273","id":379089537,"user":{"login":"dr-jts","id":3529053,"avatar_url":"https://avatars0.githubusercontent.com/u/3529053?v=4","gravatar_id":"","url":"https://api.github.com/users/dr-jts","html_url":"https://github.com/dr-jts","followers_url":"https://api.github.com/users/dr-jts/followers","following_url":"https://api.github.com/users/dr-jts/following{/other_user}","gists_url":"https://api.github.com/users/dr-jts/gists{/gist_id}","starred_url":"https://api.github.com/users/dr-jts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dr-jts/subscriptions","organizations_url":"https://api.github.com/users/dr-jts/orgs","repos_url":"https://api.github.com/users/dr-jts/repos","events_url":"https://api.github.com/users/dr-jts/events{/privacy}","received_events_url":"https://api.github.com/users/dr-jts/received_events","type":"User","site_admin":false},"created_at":"2018-04-05T21:58:34Z","updated_at":"2018-04-05T21:58:34Z","author_association":"COLLABORATOR","body":"@bjornharrtell do you have any suggestions/constraints for how to implement this?  \r\n\r\nAt the moment I am thinking of providing an implementation for `Geometry.copy()` to copy the base fields.  Subclasses will have to call `super.copy()`.\r\n\r\nAlternatively can leave `Geometry.copy()` as `abstract`, and create a `Geometry.copyBase()`."}}
{"actor":{"display_login":"dr-jts"}}