Hexagon Geospatial
MENU

GeoMedia Smart Client

GeoMedia Smart Client community discussion board is where you can create, contribute and share information and knowledge in regards to configuring as well as working with GeoMedia Smart Client. Find your answers, share your knowledge and help build a strong GeoMedia Smart Client community.
Showing results for 
Search instead for 
Do you mean 
Reply
jai
Contributor
Posts: 41
Registered: ‎10-12-2015
Accepted Solution

Detecting GPS and update its settings at client end.

Hi Team,

 

I am trying to achieve below reqirement in JAR.

1. Check GPS is "ON" or not if not than need to ON/start.

2. I need to set GPS device to location API by default at GMSC load.

3. GPS returns coordinate after it logs thrice in GPS log. It works slow, is there any other way to speed up the performance.

 

//Fetching lat lon
if(GPSCurator.getInstance() != null)
{	
    double alt = GPSCurator.getInstance().getCurrentGPSEvent().getCoordinate().getZ();
    double lat = GPSCurator.getInstance().getCurrentGPSEvent().getGpsCoordinate().getLat();
    double lon = GPSCurator.getInstance().getCurrentGPSEvent().getGpsCoordinate().getLon();
    Date date = GPSCurator.getInstance().getCurrentGPSEvent().getDate();					
}

 

Thanks,

Jai Ram gaur

Staff
Posts: 332
Registered: ‎02-04-2016

Re: Detecting GPS and update its settings at client end.

Hi Jai,

 

Could you elaborate 'slow' ? Smiley Wink

 

What type of mobile device are you using?  I assume the GPS is built in to the mobile device ?

 

Does the log file give you any clue ?

 

Thanks

 

Frank

 

jai
Contributor
Posts: 41
Registered: ‎10-12-2015

Re: Detecting GPS and update its settings at client end.

Hi Frank,

 

Could you elaborate 'slow' ? Smiley Wink

It first log thrice in GPS Trace log then return value in custome code.

 

What type of mobile device are you using?  I assume the GPS is built in to the mobile device ?

 It's a customize device for customer having GPS in built.

 

Does the log file give you any clue ?

No.

 

We also want to start GPS on smart client load and set the GPS setting to "serial device".

 

Thanks

 

Jai

jai
Contributor
Posts: 41
Registered: ‎10-12-2015

Re: Detecting GPS and update its settings at client end.

Hi Frank,

 

I am able to achieve by using location API

JSONObject retObj = new JSONObject();
LocationApiDevice gpsDevice = new LocationApiDevice();
if(GPSCurator.getInstance() != null)
{					
	gpsDevice.connect();
	GPSSettings setting = new GPSSettings(gpsDevice, 1, GPSMode.CURRENT, false, true, false, null);
GPSCurator.getInstance().setGPSSettings(setting);			   

Thread.sleep(1000);
				    
double alt = GPSCurator.getInstance().getCurrentGPSEvent().getCoordinate().getZ();
double lat = GPSCurator.getInstance().getCurrentGPSEvent().getGpsCoordinate().getLat();
double lon = GPSCurator.getInstance().getCurrentGPSEvent().getGpsCoordinate().getLon();
Date date = GPSCurator.getInstance().getCurrentGPSEvent().getDate();
retObj.put("Lat", lat);
retObj.put("Lon", lon);
retObj.put("Date", date);
retObj.put("Alt", alt);					
retObj.put("status", "Pass");
}
else
      retObj.put("status", "Fail");

Thanks,

Jai Ram

Staff
Posts: 332
Registered: ‎02-04-2016

Re: Detecting GPS and update its settings at client end.

Thanks for sharing !!

jai
Contributor
Posts: 41
Registered: ‎10-12-2015

Re: Detecting GPS and update its settings at client end.

Hi Frank,

 

We are not getting altitude from Location API as well as from Serial device.

 

Location API - Altitude comes as 0.0. Lat/Lon is comming correct.

 

Serial Device(U-blox GNSS location sensor) - It gives error in client log.

27 Sep, 2016 12:36:13 PM FINEST:	MapRenderer => used time: 124				--> [AWT-EventQueue-2] com.intergraph.web.viewer.map.GRenderEngine.render
27 Sep, 2016 12:36:13 PM SEVERE:	Invalid checksum for NMEASentence: ?b  7?b  7?b  7?b 8?b 8?b 8?b 8?b 8?b 8?b 8?b 8?b 8$GNRMC,070715.00,V,,,,,,,270916,,,N*6C				--> [pool-17-thread-1] com.intergraph.web.gpsdevices.serial.CommandPusherListener.commandFired
27 Sep, 2016 12:36:20 PM FINEST:	View GPS was removed				--> [AWT-EventQueue-2] com.intergraph.web.ui.GridController.remove
27 Sep, 2016 12:36:20 PM FINEST:	MapRenderer => used time: 157				--> [AWT-EventQueue-2] com.intergraph.web.viewer.map.GRenderEngine.render

Any help will be highly appreciable.

 

Thanks,

Jai Ram Gaur

 

Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.