Skip to content
Snippets Groups Projects
Commit c3c4c38e authored by Cyrille Valladeau's avatar Cyrille Valladeau
Browse files

ENH: improve ConvertCartoToGeoPoint GUI

parent 2756d137
No related branches found
No related tags found
No related merge requests found
...@@ -68,7 +68,7 @@ private: ...@@ -68,7 +68,7 @@ private:
SetDocLimitations("None"); SetDocLimitations("None");
SetDocAuthors("OTB-Team"); SetDocAuthors("OTB-Team");
SetDocSeeAlso(" "); SetDocSeeAlso(" ");
SetDocCLExample("otbApplicationLauncherCommandLine ConvertCartoToGeoPoint ${OTB-BIN}/bin --xcarto --ycarto --mapproj lambert93"); SetDocCLExample("otbApplicationLauncherCommandLine ConvertCartoToGeoPoint ${OTB-BIN}/bin --carto.x 367074.625 --carto.y 4835740 --mapproj utm --mapproj.utm.hemisphere true --mapproj.utm.zone 31");
AddDocTag("Coordinates"); AddDocTag("Coordinates");
AddDocTag("Projection"); AddDocTag("Projection");
} }
...@@ -79,11 +79,14 @@ private: ...@@ -79,11 +79,14 @@ private:
void DoCreateParameters() void DoCreateParameters()
{ {
AddParameter(ParameterType_Float, "xcarto", "X cartographic coordinates"); AddParameter(ParameterType_Group, "carto", "Input cartographic coordinates");
SetParameterDescription("xcarto", "X cartographic coordinates in the specified projection."); AddParameter(ParameterType_Float, "carto.x", "X cartographic coordinates");
SetParameterDescription("carto.x", "X cartographic coordinates in the specified projection.");
AddParameter(ParameterType_Float, "ycarto", "Y cartographic coordinates"); //SetParameterFloat("carto.x", 0.);
SetParameterDescription("ycarto", "Y cartographic coordinates in the specified projection.");
AddParameter(ParameterType_Float, "carto.y", "Y cartographic coordinates");
SetParameterDescription("carto.y", "Y cartographic coordinates in the specified projection.");
//SetParameterFloat("carto.y", 0.);
AddParameter(ParameterType_Choice, "mapproj", "Map projection type"); AddParameter(ParameterType_Choice, "mapproj", "Map projection type");
SetParameterDescription("mapproj", "Type of projection used for the conversion. Possible values are: utm, lambert, lambert2, lambert93, sinus, eckert4, transmercator, mollweid and svy21."); SetParameterDescription("mapproj", "Type of projection used for the conversion. Possible values are: utm, lambert, lambert2, lambert93, sinus, eckert4, transmercator, mollweid and svy21.");
...@@ -92,6 +95,7 @@ private: ...@@ -92,6 +95,7 @@ private:
AddParameter(ParameterType_Int, "mapproj.utm.zone", "zone"); AddParameter(ParameterType_Int, "mapproj.utm.zone", "zone");
SetParameterDescription( "mapproj.utm.zone", "UTM zone of the point."); SetParameterDescription( "mapproj.utm.zone", "UTM zone of the point.");
dynamic_cast< NumericalParameter<int> * >(GetParameterByKey("mapproj.utm.zone"))->SetMinimumValue(1); dynamic_cast< NumericalParameter<int> * >(GetParameterByKey("mapproj.utm.zone"))->SetMinimumValue(1);
SetParameterInt( "mapproj.utm.zone", 1);
AddParameter(ParameterType_Empty, "mapproj.utm.hemisphere", "Is in north hemisphere"); AddParameter(ParameterType_Empty, "mapproj.utm.hemisphere", "Is in north hemisphere");
SetParameterDescription( "mapproj.utm.hemisphere", "Is the point is in the north hemisphere or not."); SetParameterDescription( "mapproj.utm.hemisphere", "Is the point is in the north hemisphere or not.");
EnableParameter( "mapproj.utm.hemisphere"); EnableParameter( "mapproj.utm.hemisphere");
...@@ -138,23 +142,11 @@ private: ...@@ -138,23 +142,11 @@ private:
AddChoice("mapproj.svy21", "svy21"); AddChoice("mapproj.svy21", "svy21");
/* AddParameter(ParameterType_Float, "long", "Output long");
AddParameter(ParameterType_Group, "carto", "Cartographic coordinates"); SetParameterDescription("long", "Point longitude coordinates.");
SetParameterRole("carto", Role_Output);
AddParameter(ParameterType_Float, "carto.long", "Point long");
SetParameterDescription("carto.long", "Point long coordinates.");
SetParameterRole("carto.long", Role_Output);
AddParameter(ParameterType_Float, "carto.lat", "Point latitude");
SetParameterDescription("carto.lat", "Point latitude coordinates.");
SetParameterRole("carto.lat", Role_Output);
*/
AddParameter(ParameterType_Float, "long", "Point long");
SetParameterDescription("long", "Point long coordinates.");
SetParameterRole("long", Role_Output); SetParameterRole("long", Role_Output);
AddParameter(ParameterType_Float, "lat", "Point latitude"); AddParameter(ParameterType_Float, "lat", "Output lat");
SetParameterDescription("lat", "Point latitude coordinates."); SetParameterDescription("lat", "Point latitude coordinates.");
SetParameterRole("lat", Role_Output); SetParameterRole("lat", Role_Output);
} }
...@@ -172,8 +164,8 @@ private: ...@@ -172,8 +164,8 @@ private:
typename MapProjectionType::InputPointType cartoPoint; typename MapProjectionType::InputPointType cartoPoint;
typename MapProjectionType::OutputPointType geoPoint; typename MapProjectionType::OutputPointType geoPoint;
cartoPoint[0] = this->GetParameterFloat("xcarto"); cartoPoint[0] = this->GetParameterFloat("carto.x");
cartoPoint[1] = this->GetParameterFloat("ycarto"); cartoPoint[1] = this->GetParameterFloat("carto.y");
geoPoint = mapProjection->TransformPoint(cartoPoint); geoPoint = mapProjection->TransformPoint(cartoPoint);
......
...@@ -41,10 +41,10 @@ add_test(NAME apTvPrRigidTransform ...@@ -41,10 +41,10 @@ add_test(NAME apTvPrRigidTransform
add_test(NAME apTvPrConvertCartoToGeoPoint add_test(NAME apTvPrConvertCartoToGeoPoint
COMMAND otbTestDriver COMMAND otbTestDriver
Execute $<TARGET_FILE:otbApplicationLauncherCommandLine> Execute $<TARGET_FILE:otbApplicationLauncherCommandLine>
otbConvertCartoToGeoPoint ConvertCartoToGeoPoint
$<TARGET_FILE_DIR:otbapp_ConvertCartoToGeoPoint> $<TARGET_FILE_DIR:otbapp_ConvertCartoToGeoPoint>
--xcarto 367074.625 --carto.x 367074.625
--ycarto 4835740 --carto.y 4835740
--mapproj utm --mapproj utm
--mapproj.utm.hemisphere true --mapproj.utm.hemisphere true
--mapproj.utm.zone 31 --mapproj.utm.zone 31
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment