Java Code Examples for com.esri.core.geometry.LinearUnit#create()

The following examples show how to use com.esri.core.geometry.LinearUnit#create() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BufferProcessor.java    From defense-solutions-proofs-of-concept with Apache License 2.0 6 votes vote down vote up
private Geometry constructBuffer(double x, double y,
		double radius, String units, int wkidin, int wkidbuffer, int wkidout)
		 {
	Point center = new Point();
	center.setX(x);
	center.setY(y);
	SpatialReference srIn = SpatialReference.create(wkidin);
	SpatialReference srBuffer = SpatialReference.create(wkidbuffer);
	SpatialReference srOut = SpatialReference.create(wkidout);
	UnitConverter uc = new UnitConverter();
	String c_name = uc.findConnonicalName(units);
	int unitout = uc.findWkid(c_name);
	Unit u = LinearUnit.create(unitout);
	Point centerProj = (Point) GeometryEngine.project(center, srIn,
			srBuffer);
	Geometry buffer = GeometryEngine
			.buffer(centerProj, srBuffer, radius, u);
	Geometry bufferout = GeometryEngine.project(buffer, srBuffer, srOut);
	//String json = GeometryEngine.geometryToJson(srOut, bufferout);
	return bufferout;

}
 
Example 2
Source File: UnitConverter.java    From defense-solutions-proofs-of-concept with Apache License 2.0 5 votes vote down vote up
public double Convert( double value, int wkidin, int wkidout)
{
	Unit uin = LinearUnit.create(wkidin);
	Unit uout = LinearUnit.create(wkidout);
	value = Unit.convertUnits(value, uin, uout);
	return value;
}
 
Example 3
Source File: UnitConverter.java    From defense-solutions-proofs-of-concept with Apache License 2.0 5 votes vote down vote up
public double Convert( double value, int wkidin, int wkidout)
{
	Unit uin = LinearUnit.create(wkidin);
	Unit uout = LinearUnit.create(wkidout);
	
	value = Unit.convertUnits(value, uin, uout);
	return value;
}
 
Example 4
Source File: QueryReportProcessor.java    From defense-solutions-proofs-of-concept with Apache License 2.0 5 votes vote down vote up
private Unit queryUnit(String units)
{
	UnitConverter uc = new UnitConverter();
	String cn = uc.findConnonicalName(units);
	int unitout = uc.findWkid(cn);
	Unit  u = LinearUnit.create(unitout);
	return u;
}
 
Example 5
Source File: UnitConverter.java    From defense-solutions-proofs-of-concept with Apache License 2.0 5 votes vote down vote up
public double Convert( double value, int wkidin, int wkidout)
{
	Unit uin = LinearUnit.create(wkidin);
	Unit uout = LinearUnit.create(wkidout);
	
	value = Unit.convertUnits(value, uin, uout);
	return value;
}
 
Example 6
Source File: UnitConverter.java    From defense-solutions-proofs-of-concept with Apache License 2.0 5 votes vote down vote up
public double Convert( double value, int wkidin, int wkidout)
{
	Unit uin = LinearUnit.create(wkidin);
	Unit uout = LinearUnit.create(wkidout);
	value = Unit.convertUnits(value, uin, uout);
	return value;
}
 
Example 7
Source File: UnitConverter.java    From defense-solutions-proofs-of-concept with Apache License 2.0 5 votes vote down vote up
public double Convert( double value, int wkidin, int wkidout)
{
	Unit uin = LinearUnit.create(wkidin);
	Unit uout = LinearUnit.create(wkidout);
	
	value = Unit.convertUnits(value, uin, uout);
	return value;
}
 
Example 8
Source File: UnitConverter.java    From defense-solutions-proofs-of-concept with Apache License 2.0 5 votes vote down vote up
public double Convert( double value, int wkidin, int wkidout)
{
	Unit uin = LinearUnit.create(wkidin);
	Unit uout = LinearUnit.create(wkidout);
	
	value = Unit.convertUnits(value, uin, uout);
	return value;
}
 
Example 9
Source File: UnitConverter.java    From defense-solutions-proofs-of-concept with Apache License 2.0 5 votes vote down vote up
public double Convert( double value, int wkidin, int wkidout)
{
	Unit uin = LinearUnit.create(wkidin);
	Unit uout = LinearUnit.create(wkidout);
	
	value = Unit.convertUnits(value, uin, uout);
	return value;
}
 
Example 10
Source File: SpatialQProcessor.java    From defense-solutions-proofs-of-concept with Apache License 2.0 5 votes vote down vote up
private Unit queryUnit(String units) {
	UnitConverter uc = new UnitConverter();
	String cn = uc.findConnonicalName(units);
	int unitout = uc.findWkid(cn);
	Unit u = LinearUnit.create(unitout);
	return u;
}
 
Example 11
Source File: UnitConverter.java    From defense-solutions-proofs-of-concept with Apache License 2.0 5 votes vote down vote up
public double Convert( double value, int wkidin, int wkidout)
{
	Unit uin = LinearUnit.create(wkidin);
	Unit uout = LinearUnit.create(wkidout);
	
	value = Unit.convertUnits(value, uin, uout);
	return value;
}
 
Example 12
Source File: UnitConverter.java    From defense-solutions-proofs-of-concept with Apache License 2.0 5 votes vote down vote up
public double Convert( double value, int wkidin, int wkidout)
{
	Unit uin = LinearUnit.create(wkidin);
	Unit uout = LinearUnit.create(wkidout);
	
	value = Unit.convertUnits(value, uin, uout);
	return value;
}