-
Notifications
You must be signed in to change notification settings - Fork 160
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
ST_GeometryFromShape #103
Labels
Milestone
Comments
I found the following untracked file, never committed to git - probably did not pass testing: package com.esri.hadoop.hive;
import java.nio.ByteBuffer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.hive.ql.exec.UDFArgumentException;
import org.apache.hadoop.io.BytesWritable;
import com.esri.core.geometry.SpatialReference;
import com.esri.core.geometry.ogc.OGCGeometry;
public class ST_GeomFromShape extends ST_Geometry {
static final Log LOG = LogFactory.getLog(ST_GeomFromShape.class.getName());
public BytesWritable evaluate(BytesWritable shape) throws UDFArgumentException {
return evaluate(shape, 0);
}
public BytesWritable evaluate(BytesWritable shape, int wkid) throws UDFArgumentException {
//String wkt = shape.toString();
LOG.error("geom-from-shape"); /// debug/todo
try {
SpatialReference spatialReference = null;
if (wkid != GeometryUtils.WKID_UNKNOWN) {
spatialReference = SpatialReference.create(wkid);
}
// byte [] byteArr = shape.getBytes();
// ByteBuffer byteBuf = ByteBuffer.allocate(byteArr.length);
// byteBuf.put(byteArr);
// TODO: little-endian order: .order(ByteOrder.LITTLE_ENDIAN)
OGCGeometry ogcObj = OGCGeometry.fromEsriShape(ByteBuffer.wrap(shape.getBytes()));
ogcObj.setSpatialReference(spatialReference);
return GeometryUtils.geometryToEsriShapeBytesWritable(ogcObj);
} catch (Exception e) {
LogUtils.Log_ExceptionThrown(LOG, "geom-from-shape", e); //todo
return null;
}
}
} |
gisfromscratch
added a commit
to gisfromscratch/spatial-framework-for-hadoop
that referenced
this issue
Aug 17, 2016
gisfromscratch
added a commit
to gisfromscratch/spatial-framework-for-hadoop
that referenced
this issue
Aug 17, 2016
gisfromscratch
added a commit
to gisfromscratch/spatial-framework-for-hadoop
that referenced
this issue
Aug 17, 2016
gisfromscratch
added a commit
to gisfromscratch/spatial-framework-for-hadoop
that referenced
this issue
Aug 17, 2016
Need to add to the documentation on wiki |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ST_GeomFromShape in SQL-RDBMS
ST_AsShape for Hive
The text was updated successfully, but these errors were encountered: