[jira] [Commented] (SEDONA-97) Add ST_Force_2D function to Apache Sedona
[ https://issues.apache.org/jira/browse/SEDONA-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17524060#comment-17524060 ] Tapan Rajnikant Modi commented on SEDONA-97: I would like to work on this ticket. Can someone please assign this ticket to me? I am not able to. > Add ST_Force_2D function to Apache Sedona > - > > Key: SEDONA-97 > URL: https://issues.apache.org/jira/browse/SEDONA-97 > Project: Apache Sedona > Issue Type: Improvement >Reporter: Tapan Rajnikant Modi >Priority: Major > > ST_Force_2D — Forces the geometries into a "2-dimensional mode" so that all > output representations will only have the X and Y coordinates. > Add this function to Apache Sedone -- This message was sent by Atlassian Jira (v8.20.1#820001)
[GitHub] [incubator-sedona] kanchanchy commented on pull request #612: [SEDONA-108] Write Support for GeoTiff Raster Images
kanchanchy commented on PR #612: URL: https://github.com/apache/incubator-sedona/pull/612#issuecomment-1102064753 Hi @jiayuasu I didn't understand the writeToCRS option. If end user provides writeToCRS option during, the coordinates of the GeoTiff source should be in that CRS format, right? With this: 'It just writes CRS name together with GeoTiff.', do you mean providing an extra meta-data field for the CRS of the GeoTiff? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@sedona.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-sedona] jiayuasu commented on a diff in pull request #608: [SEDONA-106] add st line from text
jiayuasu commented on code in PR #608: URL: https://github.com/apache/incubator-sedona/pull/608#discussion_r852591258 ## sql/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/Constructors.scala: ## @@ -94,6 +94,36 @@ case class ST_PolygonFromText(inputExpressions: Seq[Expression]) } } +/** + * Return a line from a string. The string must be plain string and each coordinate must be separated by a delimiter. + * + * @param inputExpressions + */ +case class ST_LineFromText(inputExpressions: Seq[Expression]) + extends Expression with CodegenFallback with UserDataGeneratator { + // This is an expression which takes one input expressions. + assert(inputExpressions.length == 1) + + override def nullable: Boolean = false + + override def eval(inputRow: InternalRow): Any = { +val lineString = inputExpressions(0).eval(inputRow).asInstanceOf[UTF8String].toString + +var fileDataSplitter = FileDataSplitter.WKT +var formatMapper = new FormatMapper(fileDataSplitter, false, GeometryType.LINESTRING) Review Comment: After you get the geomtetry, use geometry.getGeometryType to check if it is LineString. If not, return null. see https://locationtech.github.io/jts/javadoc/org/locationtech/jts/geom/Geometry.html#getGeometryType-- -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@sedona.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-sedona] ngaur9 commented on a diff in pull request #608: [SEDONA-106] add st line from text
ngaur9 commented on code in PR #608: URL: https://github.com/apache/incubator-sedona/pull/608#discussion_r852579065 ## sql/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/Constructors.scala: ## @@ -94,6 +94,36 @@ case class ST_PolygonFromText(inputExpressions: Seq[Expression]) } } +/** + * Return a line from a string. The string must be plain string and each coordinate must be separated by a delimiter. + * + * @param inputExpressions + */ +case class ST_LineFromText(inputExpressions: Seq[Expression]) + extends Expression with CodegenFallback with UserDataGeneratator { + // This is an expression which takes one input expressions. + assert(inputExpressions.length == 1) + + override def nullable: Boolean = false + + override def eval(inputRow: InternalRow): Any = { +val lineString = inputExpressions(0).eval(inputRow).asInstanceOf[UTF8String].toString + +var fileDataSplitter = FileDataSplitter.WKT +var formatMapper = new FormatMapper(fileDataSplitter, false, GeometryType.LINESTRING) Review Comment: I just wanted to ask, if we remove the LineString, how will we identify if it is a LIne or some other geometrical figure? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@sedona.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-sedona] jiayuasu commented on a diff in pull request #608: [SEDONA-106] add st line from text
jiayuasu commented on code in PR #608: URL: https://github.com/apache/incubator-sedona/pull/608#discussion_r852520310 ## sql/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/Constructors.scala: ## @@ -94,6 +94,36 @@ case class ST_PolygonFromText(inputExpressions: Seq[Expression]) } } +/** + * Return a line from a string. The string must be plain string and each coordinate must be separated by a delimiter. + * + * @param inputExpressions + */ +case class ST_LineFromText(inputExpressions: Seq[Expression]) + extends Expression with CodegenFallback with UserDataGeneratator { + // This is an expression which takes one input expressions. + assert(inputExpressions.length == 1) + + override def nullable: Boolean = false + + override def eval(inputRow: InternalRow): Any = { +val lineString = inputExpressions(0).eval(inputRow).asInstanceOf[UTF8String].toString + +var fileDataSplitter = FileDataSplitter.WKT +var formatMapper = new FormatMapper(fileDataSplitter, false, GeometryType.LINESTRING) Review Comment: This should be `var formatMapper = new FormatMapper(fileDataSplitter, false)` as shown in https://github.com/apache/incubator-sedona/blob/master/sql/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/Constructors.scala#L145 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@sedona.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-sedona] jiayuasu commented on a diff in pull request #608: [SEDONA-106] add st line from text
jiayuasu commented on code in PR #608: URL: https://github.com/apache/incubator-sedona/pull/608#discussion_r852519668 ## docs/archive/api/sql/GeoSparkSQL-Constructor.md: ## @@ -19,6 +19,19 @@ FROM polygontable SELECT ST_GeomFromWKT('POINT(40.7128,-74.0060)') AS geometry ``` +## ST_LineFromText + +Introduction: Construct a Line from Wkt. Unlimited UUID strings can be appended. + Review Comment: Again, do NOT change this doc please. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@sedona.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-sedona] jiayuasu commented on pull request #612: Implemented Jira Issue SEDONA-108 (Write Support for GeoTiff Raster Images)
jiayuasu commented on PR #612: URL: https://github.com/apache/incubator-sedona/pull/612#issuecomment-1101898005 @kanchanchy This PR looks awesome. I have a small request regarding the CRS in GeoTIFF reader and writer. Currently, it is fixed to (1) in the reader, read from the original data files and read to EPSG 4326 (2) in the writer, write to EPSG 4326. This creates some troubles to the end user. Can you provide some optional parameters to the user such as This will write data to the desired the CRS ``` sparkSession.read.format("geotiff").option("writeFromCRS", "epsg:XXX").save("YOUR_PATH") sparkSession.read.format("geotiff").option("writeToCRS", "epsg:XXX").save("YOUR_PATH") ``` If the original GeoTiff data files does not have CRS inside, then use the following ``` sparkSession.read.format("geotiff").option("readFromCRS", "epsg:XXX").load("YOUR_PATH") sparkSession.read.format("geotiff").option("readToCRS", "epsg:XXX").load("YOUR_PATH") ``` If the original GeoTiff data files have CRS inside, `readFromCRS` will not be in effect. Both of reader and writer should have an optional parameter which is option("disableErrorInCRS", "true"). This will be the parameter used here: https://github.com/apache/incubator-sedona/blob/master/sql/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/Functions.scala#L288 The default value should be false -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@sedona.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-sedona] jiayuasu merged pull request #610: [SEDONA 95] Add ST_Disjoint predicate
jiayuasu merged PR #610: URL: https://github.com/apache/incubator-sedona/pull/610 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@sedona.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-sedona] jiayuasu commented on a diff in pull request #610: [SEDONA 95] Add ST_Disjoint predicate
jiayuasu commented on code in PR #610: URL: https://github.com/apache/incubator-sedona/pull/610#discussion_r852511063 ## flink/src/main/java/org/apache/sedona/flink/expressions/Predicates.java: ## @@ -104,4 +104,28 @@ public Boolean eval(@DataTypeHint("INT") Integer key, @DataTypeHint(value = "RAW return JudgementHelper.match(geom1, geom2, halfOpenRectangle, false); } } + +public static class ST_Disjoint extends ScalarFunction { +private List grids; + +/** + * Constructor for duplicate removal + */ +public ST_Disjoint(PartitioningUtils partitioner) { +grids = partitioner.fetchLeafZones(); +} + +/** + * Constructor for relation checking without duplicate removal + */ +public ST_Disjoint() { +} + +@DataTypeHint("Boolean") +public Boolean eval(@DataTypeHint(value = "RAW", bridgedTo = org.locationtech.jts.geom.Geometry.class) Object o1, @DataTypeHint(value = "RAW", bridgedTo = org.locationtech.jts.geom.Geometry.class) Object o2) { +Geometry geom1 = (Geometry) o1; Review Comment: In Intelij IDEA, go to the test case you want to run. Right click the test case in the source code to run the specific test case -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@sedona.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (SEDONA-92) Build failed using Intellij IDEA
[ https://issues.apache.org/jira/browse/SEDONA-92?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17523892#comment-17523892 ] Netanel Malka commented on SEDONA-92: - I tried it, but I still have those issues. The workaround for me is to exclude: incubator-sedona/sql/src/test/scala/org/apache/sedona/sql/functions/collect incubator-sedona/sql/src/test/scala/org/apache/sedona/sql/functions/geohash But now I am facing new issues from Intellij (and a lot more errors like this from Flink test packages): {code:java} java: package org.apache.sedona.flink.expressions does not exist {code} And running from Maven: {code:java} Could not find artifact org.apache.sedona:sedona-core-3.0_2.12:pom:1.2.1-incubating-SNAPSHOT in snapshots-repo {code} I would appreciate any thoughts you have on that. > Build failed using Intellij IDEA > - > > Key: SEDONA-92 > URL: https://issues.apache.org/jira/browse/SEDONA-92 > Project: Apache Sedona > Issue Type: Task >Reporter: Netanel Malka >Priority: Normal > > Build using Intellij failed with the error message: > {code:java} > /home/netanel/IdeaProjects/incubator-sedona/sql/src/test/scala/org/apache/sedona/sql/functions/collect/TestStCollect.scala:22:8 > object GeometrySample is not a member of package org.apache.sedona.sql > import org.apache.sedona.sql.{GeometrySample, TestBaseScala}{code} > This makes it harder to run tests using the Intellij and enforce me to use > maven which is not suitable for debugging and running tests. -- This message was sent by Atlassian Jira (v8.20.1#820001)
[GitHub] [incubator-sedona] ngaur9 commented on a diff in pull request #608: [SEDONA-106] add st line from text
ngaur9 commented on code in PR #608: URL: https://github.com/apache/incubator-sedona/pull/608#discussion_r851817138 ## sql/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/Constructors.scala: ## @@ -94,6 +94,37 @@ case class ST_PolygonFromText(inputExpressions: Seq[Expression]) } } +/** + * Return a line from a string. The string must be plain string and each coordinate must be separated by a delimiter. + * + * @param inputExpressions + */ +case class ST_LineFromText(inputExpressions: Seq[Expression]) Review Comment: I referred ST_GeomFromWKT function call and added a LINE filter. Please, let me know if it needs modification or refactoring. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@sedona.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-sedona] ngaur9 commented on a diff in pull request #608: [SEDONA-106] add st line from text
ngaur9 commented on code in PR #608: URL: https://github.com/apache/incubator-sedona/pull/608#discussion_r851817126 ## docs/archive/api/sql/GeoSparkSQL-Constructor.md: ## @@ -155,6 +155,24 @@ FROM polygontable SELECT ST_PolygonFromText('-74.0428197,40.6867969,-74.0421975,40.6921336,-74.0508020,40.6912794,-74.0428197,40.6867969', ',') AS polygonshape ``` +## ST_LineFromText Review Comment: I have moved it below ST_GeomFromWKT. Please let me know if it has to be moved to some other place or file. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@sedona.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-sedona] kanchanchy opened a new pull request, #612: Implemented Jira Issue SEDONA-108 (Write Support for GeoTiff Raster Images)
kanchanchy opened a new pull request, #612: URL: https://github.com/apache/incubator-sedona/pull/612 ## Is this PR related to a proposed Issue? Yes. [SEDONA-108](https://issues.apache.org/jira/browse/SEDONA-108) ## What changes were proposed in this PR? GeoTiff DataFrame can be written as GeoTiff images. ## How was this patch tested? Yes. Unit tested with various combination of test cases. ## Did this PR include necessary documentation updates? Yes. Documentation has been updated. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@sedona.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [incubator-sedona] kanchanchy closed pull request #611: Jira Issue SEDONA-108 (Writing GeoTiff) Implemented
kanchanchy closed pull request #611: Jira Issue SEDONA-108 (Writing GeoTiff) Implemented URL: https://github.com/apache/incubator-sedona/pull/611 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@sedona.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Created] (SEDONA-110) Add ST_GeomFromGeoHash to Sedona flink
Netanel Malka created SEDONA-110: Summary: Add ST_GeomFromGeoHash to Sedona flink Key: SEDONA-110 URL: https://issues.apache.org/jira/browse/SEDONA-110 Project: Apache Sedona Issue Type: Task Reporter: Netanel Malka Assignee: Netanel Malka As a result, the constructors part of Sedona Flink will match Sedona SQL -- This message was sent by Atlassian Jira (v8.20.1#820001)