{"action":"closed","issue":{"url":"https://api.github.com/repos/DataSystemsLab/GeoSpark/issues/248","repository_url":"https://api.github.com/repos/DataSystemsLab/GeoSpark","labels_url":"https://api.github.com/repos/DataSystemsLab/GeoSpark/issues/248/labels{/name}","comments_url":"https://api.github.com/repos/DataSystemsLab/GeoSpark/issues/248/comments","events_url":"https://api.github.com/repos/DataSystemsLab/GeoSpark/issues/248/events","html_url":"https://github.com/DataSystemsLab/GeoSpark/issues/248","id":338470576,"node_id":"MDU6SXNzdWUzMzg0NzA1NzY=","number":248,"title":"CRSTransform issue","user":{"login":"Imbruced","id":22958216,"node_id":"MDQ6VXNlcjIyOTU4MjE2","avatar_url":"https://avatars2.githubusercontent.com/u/22958216?v=4","gravatar_id":"","url":"https://api.github.com/users/Imbruced","html_url":"https://github.com/Imbruced","followers_url":"https://api.github.com/users/Imbruced/followers","following_url":"https://api.github.com/users/Imbruced/following{/other_user}","gists_url":"https://api.github.com/users/Imbruced/gists{/gist_id}","starred_url":"https://api.github.com/users/Imbruced/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Imbruced/subscriptions","organizations_url":"https://api.github.com/users/Imbruced/orgs","repos_url":"https://api.github.com/users/Imbruced/repos","events_url":"https://api.github.com/users/Imbruced/events{/privacy}","received_events_url":"https://api.github.com/users/Imbruced/received_events","type":"User","site_admin":false},"labels":[{"id":203798874,"node_id":"MDU6TGFiZWwyMDM3OTg4NzQ=","url":"https://api.github.com/repos/DataSystemsLab/GeoSpark/labels/Frequently%20Asked%20Question","name":"Frequently Asked Question","color":"cc317c","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-07-05T08:16:34Z","updated_at":"2018-07-11T18:11:39Z","closed_at":"2018-07-11T18:11:39Z","author_association":"NONE","body":"GeoSpark version **1.1.3**\r\nSpark version  **2.3**\r\nJRE version = **1.8**\r\nScala = **2.11.8**\r\nAPI type = **Scala**\r\n\r\n##Data Example docs\r\n\r\n`{ \"type\": \"Feature\", \"properties\": { \"STATEFP\": \"01\", \"COUNTYFP\": \"077\", \"TRACTCE\": \"011501\", \"BLKGRPCE\": \"5\", \"AFFGEOID\": \"1500000US010770115015\", \"GEOID\": \"010770115015\", \"NAME\": \"5\", \"LSAD\": \"BG\", \"ALAND\": 6844991, \"AWATER\": 32636 }, \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [ [ [ -87.621765, 34.873444 ], [ -87.617535, 34.873369 ], [ -87.6123, 34.873337 ], [ -87.604049, 34.873303 ], [ -87.604033, 34.872316 ], [ -87.60415, 34.867502 ], [ -87.604218, 34.865687 ], [ -87.604409, 34.858537 ], [ -87.604018, 34.851336 ], [ -87.603716, 34.844829 ], [ -87.603696, 34.844307 ], [ -87.603673, 34.841884 ], [ -87.60372, 34.841003 ], [ -87.603879, 34.838423 ], [ -87.603888, 34.837682 ], [ -87.603889, 34.83763 ], [ -87.613127, 34.833938 ], [ -87.616451, 34.832699 ], [ -87.621041, 34.831431 ], [ -87.621056, 34.831526 ], [ -87.62112, 34.831925 ], [ -87.621603, 34.8352 ], [ -87.62158, 34.836087 ], [ -87.621383, 34.84329 ], [ -87.621359, 34.844438 ], [ -87.62129, 34.846387 ], [ -87.62119, 34.85053 ], [ -87.62144, 34.865379 ], [ -87.621765, 34.873444 ] ] ] } }`\r\n\r\n##Input Data \r\n(non-swapped coordinates)\r\n```\r\n{\"type\": \"Feature\", \"properties\": {\"s\": \"1\"}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [21.0031079003685, 52.251448699755]}}\r\n{\"type\": \"Feature\", \"properties\": {\"s\": \"2\"}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [20.993748100717, 52.2515109997325]}}\r\n{\"type\": \"Feature\", \"properties\": {\"s\": \"3\"}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [20.9965078998777, 52.2447324997481]}}\r\n{\"type\": \"Feature\", \"properties\": {\"s\": \"4\"}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [20.9884360000591, 52.2523919996039]}}\r\n{\"type\": \"Feature\", \"properties\": {\"s\": \"5\"}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [20.9995256995888, 52.237886899741]}}\r\n\r\n```\r\n(swapped coordinates)\r\n```\r\n{\"type\": \"Feature\", \"properties\": {\"s\": \"1\"}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [52.251448699755, 21.0031079003685]}}\r\n{\"type\": \"Feature\", \"properties\": {\"s\": \"2\"}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [52.2515109997325, 20.993748100717]}}\r\n{\"type\": \"Feature\", \"properties\": {\"s\": \"3\"}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [52.2447324997481, 20.9965078998777]}}\r\n{\"type\": \"Feature\", \"properties\": {\"s\": \"4\"}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [52.2523919996039, 20.9884360000591]}}\r\n{\"type\": \"Feature\", \"properties\": {\"s\": \"5\"}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [52.237886899741, 20.9995256995888]}}\r\n\r\n```\r\n## Expected behavior\r\nCRSTransform (between wgs84 and epsg:2180) should return Coordinates in EPSG:2180 reference system\r\nExpected coordinates (Calculated using Postgis)\r\n•\t**Y:** 489157.9670993080\t        **X:** 636694.6491001523\r\n•\t**Y:** 489147.2725993283\t\t**X:** 636055.7983001487\r\n•\t**Y:** 488398.8441993221\t        **X:** 636264.8829001492\r\n•\t**Y:** 489235.2560993396\t\t**X:** 635690.6416001465\r\n•\t**Y:** 487643.4503993159\t\t**X:** 636491.8387001511\r\n\r\n## Actual behavior (using longitude, latitude order coordinates)\r\n•\t**X:**-2570744.61941419 \t**Y:** 4105622.841167394\r\n•\t**X:**-2571917.45477289 \t**Y:** 4105906.570751074\r\n•\t**X:**-2571759.04385405 \t**Y:** 4105026.129844411\r\n•\t**X:**-2572559.67251450 \t**Y:** 4106167.238436134\r\n•\t**X:**-2571570.10109146\t**Y:** 4104130.249010921\r\n\r\nBut When I swapped coordinates (lat, lon order) The result is similar to PostgreSQL (mm difference)\r\n•\t**Y:** 489157.9714305857 \t**X:** 636694.6489803677\r\n•\t**Y:** 489147.2769306116 \t**X:** 636055.7981809259\r\n•\t**Y:** 488398.8485313682 \t**X:** 636264.8827807559\r\n•\t**Y:** 489235.26043052226 \t**X:** 635690.6414812461\r\n•\t**Y:** 487643.4547321461 \t**X:** 636491.8385805632\r\n\r\n## Steps to reproduce the problem\r\n```\r\nimport org.datasyslab.geospark.spatialRDD._\r\nimport org.datasyslab.geospark.enums._\r\n\r\nval swappedLoc = \"/example_location/swapped.geojson\"\r\nvar swappedRDD = new PointRDD(sc,\r\n                              swappedLoc,\r\n                              RDDSplitter,\r\n                              true)\r\n\r\nval nonSwappedLoc = \"/example_location/non_swapped.geojson\"\r\nvar nonSwappedRDD = new PointRDD(sc,\r\n                              nonSwappedLoc,\r\n                              RDDSplitter,\r\n                              true)\r\n\r\nswappedRDD.CRSTransform(\"epsg:4326\", \"epsg:2180\")\r\nnonSwappedRDD.CRSTransform(\"epsg:4326\", \"epsg:2180\")\r\n\r\nswappedRDD.rawSpatialRDD.collect\r\n\r\nnonSwappedRDD.rawSpatialRDD.collect\r\n```\r\n\r\n## Settings\r\nCode used in **spark shell**"}}
{"actor":{"display_login":"jiayuasu"}}