mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-15 09:00:36 +00:00
fixed parsing coordinates
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@604 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
40da8789c6
commit
dc0f0ea8cc
1 changed files with 4 additions and 4 deletions
|
@ -225,8 +225,8 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
||||||
{
|
{
|
||||||
final int type = suggestion.getInt("type");
|
final int type = suggestion.getInt("type");
|
||||||
final String value = suggestion.getString("value");
|
final String value = suggestion.getString("value");
|
||||||
final int lat = suggestion.getInt("ycoord");
|
final int lat = suggestion.optInt("ycoord");
|
||||||
final int lon = suggestion.getInt("xcoord");
|
final int lon = suggestion.optInt("xcoord");
|
||||||
int localId = 0;
|
int localId = 0;
|
||||||
final Matcher m = P_AJAX_GET_STOPS_ID.matcher(suggestion.getString("id"));
|
final Matcher m = P_AJAX_GET_STOPS_ID.matcher(suggestion.getString("id"));
|
||||||
if (m.matches())
|
if (m.matches())
|
||||||
|
@ -270,7 +270,7 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Pattern P_XML_MLC_REQ_ID = Pattern.compile(".*?@L=(\\d+)@.*?");
|
private static final Pattern P_XML_MLC_REQ_ID = Pattern.compile(".*?@L=(\\d+)@.*?");
|
||||||
private static final Pattern P_XML_MLC_REQ_LONLAT = Pattern.compile(".*?@X=(\\d+)@Y=(\\d+)@.*?");
|
private static final Pattern P_XML_MLC_REQ_LONLAT = Pattern.compile(".*?@X=(-?\\d+)@Y=(-?\\d+)@.*?");
|
||||||
|
|
||||||
protected final List<Location> xmlMLcReq(final CharSequence constraint) throws IOException
|
protected final List<Location> xmlMLcReq(final CharSequence constraint) throws IOException
|
||||||
{
|
{
|
||||||
|
@ -326,7 +326,7 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
||||||
final String r = pp.getAttributeValue(null, "r");
|
final String r = pp.getAttributeValue(null, "r");
|
||||||
final Matcher iMatcherLonLat = P_XML_MLC_REQ_LONLAT.matcher(i != null ? i : r);
|
final Matcher iMatcherLonLat = P_XML_MLC_REQ_LONLAT.matcher(i != null ? i : r);
|
||||||
if (!iMatcherLonLat.matches())
|
if (!iMatcherLonLat.matches())
|
||||||
throw new IllegalStateException("cannot parse lon/lat: '" + i + "'");
|
throw new IllegalStateException("cannot parse lon/lat: '" + i + "' or '" + r + "'");
|
||||||
final int lon = Integer.parseInt(iMatcherLonLat.group(1));
|
final int lon = Integer.parseInt(iMatcherLonLat.group(1));
|
||||||
final int lat = Integer.parseInt(iMatcherLonLat.group(2));
|
final int lat = Integer.parseInt(iMatcherLonLat.group(2));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue